Skip to content
Prev 363152 / 398502 Next

foreach {parallel} nested with for loop to update data.frame column

Hiya,
Yes that would work, also an aggregate with merge can work, but I really would like to make this a parallel calculation with farming out the first loop to different workers and put the output together again into the data.frame with additional columns. This will speed up work with very large files and avoid running out of memory issues

Cheers
H
XXXXXXXXXXXXXXXXXXXXXX Petr wrote XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Hi 

I may be completely wrong but isn't it work for ave? With your example I get
? ?x ?y ? ? z ?mins 
1 13 15 ?1.97 -2.91 
2 17 ?9 14.90 -2.81 
3 ?9 10 34.68 -1.97 
4 17 ?6 ?4.26 -2.63 
5 ?3 12 ?0.12 ?0.12 
6 19 11 ?7.91 ?7.91
Cheers 
Petr