R 并行扩展是否破坏了“apply”隐喻?
每次我在 R 中看到有关并行处理的问题时,它都会使用 foreach
函数。由于 for
循环与 R 不太相似,是否存在 apply
的并行版本?如果有,为什么它不更流行?
Every time I see a question on parallel processing in R, it uses the foreach
function. Since for
loops are not very R-like, is there a parallel version of apply
, and if so why isn't it more popular?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
*apply
有许多并行版本,从parLapply()
mclapply()
mpi.apply() Rmpi 中的
以及专用软件包,例如 papply(可能不再维护)。
There are numerous parallel versions of
*apply
, starting withparLapply()
in snowmclapply()
in multicorempi.apply()
in Rmpias well as dedicated packages such as papply (possibly no longer maintained).
@德克是正确的。我想补充一点,
plyr
包现在支持并行后端。对于
plyr
包,可能很少被提及,因为放入并行后端不需要任何考虑:它只是一个标志。@Dirk is correct. I'd add that the
plyr
package now has support for a parallel backend.In the case of the
plyr
package, it may be the case that little is mentioned because dropping in a parallel backend doesn't take any thought: it's just a flag.