Inline below.
On Fri, Sep 21, 2012 at 9:05 AM, R. Michael Weylandt
wrote:
> On Fri, Sep 21, 2012 at 5:43 AM, Tjun Kiat Teo wrote:
>> I am trying to do parallel programming and I tried this
>>
>> library(doSNOW)
>> library(foreach)
>>
>> testfunc<-function(x){
>> x<-x+1
>> x
>> }
>>
>> noc<-2
>>
On Fri, Sep 21, 2012 at 5:43 AM, Tjun Kiat Teo wrote:
> I am trying to do parallel programming and I tried this
>
> library(doSNOW)
> library(foreach)
>
> testfunc<-function(x){
> x<-x+1
> x
> }
>
> noc<-2
>
> cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK")
> registerDo
Then don't do that.
Use your script file to define functions. Source that file before the loop to
load them into memory. Call those functions from within your loop.
---
Jeff NewmillerThe .
3 matches
Mail list logo