Hello,

I am trying to run a small example with foreach, but I am having some
problems. Here is the code:

*library(doMC)
registerDoMC()

zappa = list()
frank = list()

foreach (i = 1:4) %dopar% {
 zappa[[i]] = kmeans (iris[-5],4)
 frank[[i]] = warnings()
}*

The code runs without error. However the zappa and frank will be empty
lists.
If I use regular *for *instead, the list will be filled up with kmeans and
warnings results. However, it will not be processed distributed.

What am I doing wrong?
What am I not understanding?

Thanks

Rui

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to