Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deprecation of multicore (mclapply) in R 3.0

I understand multicore is deprecated as of R version 2.14 and I was advised to start using the package parallel which comes built into the base of R 3.0.

Going through the documentation of parallel, I found that there are mainly two functions to call parallel and collect for example:

p <- parallel(1:10)
q <- parallel(1:20)
collect(list(p, q)) # wait for jobs to finish and collect all results

Since I'm not very familiar with the details of parallel computing, I've always used multicore's mclapply out of the box in my code. I wondering how I could take advantage of the new parallel package similarly to mclapply.

Cheers

like image 270
Omar Wagih Avatar asked May 29 '13 22:05

Omar Wagih


1 Answers

As mentioned by @Ben Bolker, the mclapply is now integrated into R's base as of 3.0. Just load the package parallel. No need to have multicore

require(parallel) 
mclapply(1:30, rnorm)
like image 65
Omar Wagih Avatar answered Oct 03 '22 23:10

Omar Wagih