par_sapply: A friendlier parSapply.

Description Usage Arguments Value Examples

Description

A sleek wrapper on the function parSapply. This function does not require user to allocate clusters and then stop them. This function uses parSapply across half the available cores and after the computation is done, it stops the clusters as well. The inputs are same os parSapply from parallel package

Usage

1
par_sapply(X, FUNC, detect_cores)

Arguments

X

The vector of value to perform paralleized sapply on.

FUNC

Function to be applied to every value of X, similar to sapply

detect_cores

If False (default), 2 cores are used. If True, half the number of cores are used on Mac OS else 2 cores are used.

Value

The a vector just like sapply. It does applies the function on X in parallel and hence is very fast.

Examples

1
par_sapply(1:100, function(x) x*100)

featurizer documentation built on May 2, 2019, 2:06 a.m.