Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread Bos, Roger
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 =

Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread saskay
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

Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread Bos, Roger
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

Re: [R] foreach not recognizing functions in memory

2011-07-12 Thread Adrienne Wootten
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

Re: [R] foreach not recognizing functions in memory

2011-07-12 Thread David Winsemius
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