selectPar.pplyFun: Select an appropriate *pply function

Description Usage Arguments Details Value Warning Author(s) See Also

View source: R/helpers.R

Description

Selects an appropriate *pply function depending on the parallel choice

Usage

1
2
selectPar.pplyFun(parallel.pars, .pplyFUN = c("apply", "lapply",
  "sapply", "mapply"))

Arguments

parallel.pars

The output from parallelCheck, passing the parallelization options.

.pplyFUN

*pply function to be used. Current options are "apply", "lapply", "sapply" and "mapply".

Details

The output function will be either parallel::parLapply or lapply for .pplyFUN = "lapply", depending of whether parallelization is enabled or not. Same for apply and parallel::parApply and so on.

Value

A function

Warning

From the makeCluster help: “It is good practice to shut down the workers by calling stopCluster”. It is therefore recommended the following line of code after using this function: on.exit(parallel::stopCluster(parallel.pars$cl))

Author(s)

J. Bedia

See Also

Other parallel.helpers: parallelCheck


SantanderMetGroup/transformeR documentation built on Feb. 14, 2020, 5:55 p.m.