Re: [R] dopar parallel assignments

2010-04-30 Thread Steve Lianoglou
Hi Vivek, On Thu, Apr 29, 2010 at 8:37 PM, Vivek Ayer wrote: > Hi David, > > Thanks for the help. It's working! I still find it to be a new > concept. I haven't encountered storing loops in objects in any other > languages. Can it even be done in other languages? Very novel, quite > intriguing.

Re: [R] dopar parallel assignments

2010-04-29 Thread Vivek Ayer
Hi David, Thanks for the help. It's working! I still find it to be a new concept. I haven't encountered storing loops in objects in any other languages. Can it even be done in other languages? Very novel, quite intriguing. Thanks again, Vivek On Thu, Apr 29, 2010 at 3:44 PM, David M Smith wrote

Re: [R] dopar parallel assignments

2010-04-29 Thread David M Smith
[This relates to the foreach function in library(foreach)] Vivek, In the %dopar% example, the assignments are being made into "child" R sessions in parallel. foreach is generally pretty good about detecting variables you reference in the parallel loops and making sure the objects are copied over

Re: [R] dopar parallel assignments

2010-04-29 Thread Erik Iverson
Vivek Ayer wrote: Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } ... and which package are these functions in? __

[R] dopar parallel assignments

2010-04-29 Thread Vivek Ayer
Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } Obviously, the difference is %dopar% vs. %do%. If I use %do%, I get objec