11

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

4

1 回答 1

11

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)
于 2013-06-06T04:45:23.507 回答