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% testFun(m)

helper <- function(i) {

   out <- foreach(m=1:i, .combine=rbind,*.export="testFun", .verbose=T*)
%dopar% testFun(m)
 }

 out <- helper(10)

--
View this message in context: 
http://r.789695.n4.nabble.com/foreach-not-recognizing-functions-in-memory-tp3663603p3665806.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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