[R-sig-hpc] getting multiple results back from foreach using MPI
Brian G. Peterson
brian at braverock.com
Mon Jan 17 15:38:12 CET 2011
On 01/17/2011 08:29 AM, Maas James Dr (MED) wrote:
> I'm relatively new to this. I have a toy script (listed below) that runs on a SGE cluster using doMPI. When I ask for the results ("stuff"), all I'm getting is the final variable calculated ("bsiaicORSD") as shown here. I need the function to return both "bsiaicOR" and "bsiaic". What do I need to do to get foreach to give me both back? I've tried using a "return" statement within the foreach loop but got a "multi argument returns are not permitted" error message.
>
<...>
bsiaicOR <- apply(results$OR, c(1,2), mean)
bsiaicORSD <- apply(results$OR, c(1,2), sd)
ret<-list(bsiaicOR,bsiaicORSD)
return(ret)
}
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-sig-hpc
mailing list