Why doesn't the plyr package use my parallel backend?

ぐ巨炮叔叔 提交于 2019-12-04 03:48:27

Try this setup:

library(doParallel)
library(plyr)

nodes <- detectCores()
cl <- makeCluster(nodes)
registerDoParallel(cl)

aaply(ozone, 1, mean,.parallel=TRUE)

stopCluster(cl)

Since I have never used plyr for parallel computing I have no idea why this issues warnings. The result is correct anyway.

The documentation for aaply states

.parallel: if ‘TRUE’, apply function in parallel, using parallel backend provided by foreach

so presumably you need to use the foreach package rather than the parallel package.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!