Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do the R parallel extensions break the `apply` metaphor?

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?

like image 305
Ari B. Friedman Avatar asked Jul 29 '11 11:07

Ari B. Friedman


2 Answers

There are numerous parallel versions of *apply, starting with

  • parLapply() in snow
  • mclapply() in multicore
  • mpi.apply() in Rmpi

as well as dedicated packages such as papply (possibly no longer maintained).

like image 62
Dirk Eddelbuettel Avatar answered Sep 23 '22 01:09

Dirk Eddelbuettel


@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.

like image 27
Iterator Avatar answered Sep 23 '22 01:09

Iterator