Actually, you'll need to identify the values of the foreach loop in the for
loop for it to work...
require(doParallel)
require(foreach)
set.seed(666)
xyz<-as.data.frame(cbind(x=rep(rpois(5,10),2)+1,
y=rep(rpois(5,10),2)+1,z=round(runif(10, min=-3, max=40),2)))
xyz$mins<-rep(NA, nrow(
lp [mailto:[hidden email]] On Behalf Of [hidden email]
> Sent: Thursday, August 4, 2016 3:32 AM
> To: [hidden email]
> Subject: [R] foreach {parallel} nested with for loop to update
> data.frame column
>
> Hi List,
>
> Trying to update a data.frame column within a foreach neste
ail]
> Sent: Thursday, August 4, 2016 3:32 AM
> To: [hidden email]
> Subject: [R] foreach {parallel} nested with for loop to update data.frame
> column
>
> Hi List,
>
> Trying to update a data.frame column within a foreach nested for loop
>
> ### trial data
&
5 3 12 0.12 0.12
6 19 11 7.91 7.91
>
Cheers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
> alexander.h...@csiro.au
> Sent: Thursday, August 4, 2016 3:32 AM
> To: r-h...@stat.math.ethz.ch
> Subject: [R] foreach
Hi List,
Trying to update a data.frame column within a foreach nested for loop
### trial data
set.seed(666)
xyz<-as.data.frame(cbind(x=rep(rpois(5000,10),2)+1,
y=rep(rpois(5000,10),2)+1,z=round(runif(1, min=-3, max=40),2)))
xyz$mins<-rep(NA, nrow(xyz))
cl<-makeCluster(16) #adjust to your
5 matches
Mail list logo