我有一些 plyr 代码,用于运行我编写的 Rcpp 函数:
nodes = detectCores()
cl = makeCluster(nodes)
registerDoParallel(cl)
l = llply(mylist, function(x) {
.Call("myfancyfunction", PACKAGE = "mypackage", ...)
}, .parallel = TRUE, .paropts = list(.packages = "mypackage"))
但是,即使我包含包,我也会收到错误:
Error in do.ply(i) :
task 1 failed - ""myfancyfunction" not available for .Call() for package "mypackage""
如何使并行进程可以访问我的库?