Set up and run parallel computations.
lapply_canprot(X, FUN, ..., varlist = NULL, min.length = 10)
vector (atomic or list)
function or character string naming a function
additional arguments to pass to <U+2018>FUN<U+2019>
character, names of variables to export
numeric, minimum length of X for running parallel computations
If length(X)
is less than min.length
, this function simply calls lapply
given the X
, FUN
and ...
arguments, and returns the result.
Otherwise, a cluster is initiatied by loading CHNOSZ and canprot and setting up the respective data environments (thermo
and canprot
).
If varlist
is supplied, the named variables are exported to the global environment of each node in the cluster using clusterExport
.
Then, parallel computations in the cluster are run using parLapply
given the X
, FUN
and ...
arguments.
For examples, see the data vignettes and the help for pdat_
.