Re: [R] From nested loop to mclapply

2011-04-19 Thread Alaios
elp Best Regards Alex --- On Mon, 4/18/11, Allan Engelhardt wrote: > From: Allan Engelhardt > Subject: Re: [R] From nested loop to mclapply > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, April 18, 2011, 5:36 PM > Try help("expand.grid", > pa

Re: [R] From nested loop to mclapply

2011-04-18 Thread Allan Engelhardt
Try help("expand.grid", package="base") for one way to create the combinations of (i,j) outside the loop, or perhaps vignette("nested", package="foreach") which does it "automatically" (rather: naturally). Allan On 18/04/11 16:53, Alaios wrote: Dear all, I am trying to find a decent way to sp

[R] From nested loop to mclapply

2011-04-18 Thread Alaios
Dear all, I am trying to find a decent way to speed up my code. So far I have used mclapply with really good results (parallel version of lapply). I have a nested loop that I would like to help me convert it to lapply for (i in seq(from=-1,to=1-2/ncol(sr),length=ncol(sr))){ for (j in s