Learn R Programming

jubilee (version 0.3.3)

jubilee.mcsapply: Wrapper to calculate sapply using multi-core

Description

This utility calculates sapply using multi-core capability. It is a simple wrapper on simplify2array and parallel::mclapply. It is particularly convenient on Linux and Mac when parallelism saves significant amount of computing time.

Usage

jubilee.mcsapply(x, FUN, ...)

Arguments

x

numeric

FUN

the function to be applied to each element of x

...

optional arguments to FUN

Value

numeric

Examples

Run this code
# NOT RUN {
   a <- seq(1,100)
   jubilee.mcsapply(a, function(x) x^2) # use multi-core!
# }

Run the code above in your browser using DataLab