Skip to contents

Some computations take considerable amount of time to execute. This function provides a helper wrapper for running functions of the apply family to specified outputs.

Usage

run_parallel(
  X,
  FUN,
  cores = 1,
  approach = "future",
  export_packages = NULL,
  ...
)

Arguments

X

A list, data.frame or matrix object to be fed to a single core or parallel apply call.

FUN

A function passed on for computation.

cores

A numeric of the number of cores to use (Default: 1).

approach

character for the parallelization approach taken (Options: "parallel" or "future").

export_packages

A vector with packages to export for use on parallel nodes (Default: NULL).

...

Any other parameter passed on.

Details

By default, the parallel package is used for parallel computation, however an option exists to use the future package instead.

Examples

if (FALSE) { # \dontrun{
 run_parallel(list, mean, cores = 4)
} # }