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?
每次我在R中看到关于并行处理的问题时,它都使用foreach函数。因为for循环不是很像R,是否有一个并行版本的应用,如果是这样,为什么它不是更受欢迎?
2 个解决方案
#1
9
There are numerous parallel versions of *apply
, starting with
有许多并行版本的* apply,从开始
-
parLapply()
in snow -
mclapply()
in multicore -
mpi.apply()
in Rmpi
雪中的parLapply()
多核中的mclapply()
在Rmpi中的mpi.apply()
as well as dedicated packages such as papply (possibly no longer maintained).
以及papply等专用软件包(可能不再维护)。
#2
1
@Dirk is correct. I'd add that the plyr
package now has support for a parallel backend.
@Dirk是对的。我补充一点,plyr包现在支持并行后端。
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.
在plyr包的情况下,可能会出现这样的情况,因为在并行后端中丢弃并不需要考虑:它只是一个标志。
#1
9
There are numerous parallel versions of *apply
, starting with
有许多并行版本的* apply,从开始
-
parLapply()
in snow -
mclapply()
in multicore -
mpi.apply()
in Rmpi
雪中的parLapply()
多核中的mclapply()
在Rmpi中的mpi.apply()
as well as dedicated packages such as papply (possibly no longer maintained).
以及papply等专用软件包(可能不再维护)。
#2
1
@Dirk is correct. I'd add that the plyr
package now has support for a parallel backend.
@Dirk是对的。我补充一点,plyr包现在支持并行后端。
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.
在plyr包的情况下,可能会出现这样的情况,因为在并行后端中丢弃并不需要考虑:它只是一个标志。