Re: [R] nested for loops too slow

2015-04-12 Thread Bert Gunter
Well, sort of... aggregate() is basically a wrapper for lapply(), which ultimately must loop over the function call at the R interpreter level, as opposed to vectorized functions that loop at the C level and hence can be orders of magnitude faster. As a result, there is often little difference in

[R] Can't load CARET package, on Mac OS X (latest), on R version 3.1.2 (2014-10-31)

2015-04-12 Thread samarvir singh
I installed CARET package, but when I try to load CARET. I see this error. Please help. thank you install.packages(caret) trying URL ' http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/caret_6.0-41.tgz' Content type 'application/x-gzip' length 3997718 bytes (3.8 Mb) opened URL

Re: [R] Can't load CARET package, on Mac OS X (latest), on R version 3.1.2 (2014-10-31)

2015-04-12 Thread John Kane
Can you post the results of a sessionInfo() It looks like you may have an old installation of R John Kane Kingston ON Canada -Original Message- From: samarvir1...@gmail.com Sent: Sun, 12 Apr 2015 14:01:14 +0530 To: r-help@r-project.org Subject: [R] Can't load CARET package, on

Re: [R] Can't load CARET package, on Mac OS X (latest), on R version 3.1.2 (2014-10-31)

2015-04-12 Thread Prof Brian Ripley
Several issues 1) The problem is with minqa, not caret (let alone CARET: R is case-sensitive). 2) As the posting guide says, update your R before posting. 3) We are missing the 'at a minimum' information, the output of sessionInfo(). You have not told us how you installed R, but my guess

[R] nested for loops too slow

2015-04-12 Thread Morway, Eric
The small example below works lighting-fast; however, when I run the same script on my real problem, a 1Gb text file, the for loops have been running for over 24 hrs and I have no idea if the processing is 10% done or 90% done. I have not been able to figure out a betteR way to code up the

Re: [R] Obfuscate AES password

2015-04-12 Thread Jeff Newmiller
The topic of this list is R, not security. For the purposes of this mailing list the user needs to take responsibility for the password. If you want to take that responsibility (cache it) from the user then you need to talk to experts on security so you can become one yourself. IMHO

Re: [R] Obfuscate AES password

2015-04-12 Thread Luca Cerone
Hi Jeff, thanks, actually my question is how to do this in R, I don't think I am being out of topic. Other programming/scripting languages provide interfaces to the OS password keyring that allows users to encrypt files using the user master password, but I have no idea how to do this in R.

Re: [R] nested for loops too slow

2015-04-12 Thread J Robertson-Burns
You are certainly in Circle 2 of 'The R Inferno', which I suspect is where almost all of the computation time is coming from. Instead of doing: divChng - rbind(divChng,c(datTS$ts[1], SEG[j], DC, GRW, max(datTS$iter))) it would be much better to create 'divChng' to be the final length and then

[R] Obfuscate AES password

2015-04-12 Thread Luca Cerone
Hi, I need some help with obfuscating AES key on Windows, Linux and Mac. I have asked the same question on stackoverflow, but since I didn't receive any input I have decided to post it here too. You can find my question at: http://stackoverflow.com/questions/29580742/protect-aes-key-used-in-r-code

Re: [R] Obfuscate AES password

2015-04-12 Thread Jeff Newmiller
Sigh. I still disagree that your question is on topic, but someone else may offer something more helpful than I can. You are being rather vague about this API... and if you identified it specifically then I would probably object that it was almost certainly very specific to a single operating

Re: [R] nested for loops too slow

2015-04-12 Thread Thierry Onkelinx
You don't need loops at all. grw - aggregate(gw ~ ts + ISEG + iter, data = dat, FUN = sum) GRW - aggregate(gw ~ ts + ISEG, data = grw, FUN = function(x){max(x) - min(x)}) DC - aggregate(div ~ ts + ISEG, data = subset(dat, IRCH == 1), FUN = function(x){max(x) - min(x)}) iter -