askay
Sent: Wednesday, July 13, 2011 2:59 PM
To: r-help@r-project.org
Subject: Re: [R] foreach not recognizing functions in memory
Try the below code:
==
library(foreach)
library(doSNOW)
getDoParWorkers()
getDoParName()
registerDoSNOW(makeCluster(2, type =
Try the below code:
==
library(foreach)
library(doSNOW)
getDoParWorkers()
getDoParName()
registerDoSNOW(makeCluster(2, type = "SOCK"))
getDoParWorkers()
getDoParName()
testFun <- function(m) {
out <- m*m
}
out <- foreach(m=1:10, .combine=rbind,*.verbose=T*) %dopar
Subject: Re: [R] foreach not recognizing functions in memory
Roger,
I think I know why you are having a problem. Your foreach is using %dopar% and
judging from your output you have active parallel processing. When running
something in paralell, the master is the processor used by the Rgui, and
Roger,
I think I know why you are having a problem. Your foreach is using
%dopar% and judging from your output you have active parallel
processing. When running something in paralell, the master is the
processor used by the Rgui, and the slaves are in the background. My
guess is the the functio
On Jul 12, 2011, at 5:28 PM, Bos, Roger wrote:
All,
I am not understanding the scoping used in foreach when it is used
inside a function. I keep getting "could not find function" errors
for
functions that are in memory when I try to use foreach within a
function
call. I have a simple exa
5 matches
Mail list logo