[R-sig-hpc] .combine in foreach

Maas James Dr (MED) J.Maas at uea.ac.uk
Sat Dec 18 16:11:29 CET 2010

I’m testing using the foreach package to see if it will parrallelize a Bayesian MCMC routine.  It appears to work well, just gives back huge results files when I run multiple iterations.  I’m looking at the .combine option ... is there an easy way to get it combine the results across components and still maintain the matrix structure?  Several of the outputs are 3x3 matrices, but I get 1000 of them, one in each component.  If possible I’d like to get the mean matrix, i.e  (m1 +m2+m3 ... m1000 ) / 1000  if that makes any sense!?
Any suggestions most welcome, thanks for help.


Dr. Jim Maas
University of East Anglia

More information about the R-sig-hpc mailing list