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.
Arguments
- X
A
list,data.frameormatrixobject to be fed to a single core or parallel apply call.- FUN
A
functionpassed on for computation.- cores
A numeric of the number of cores to use (Default:
1).- approach
characterfor the parallelization approach taken (Options:"parallel"or"future").- export_packages
A
vectorwith packages to export for use on parallel nodes (Default:NULL).- ...
Any other parameter passed on.
Value
A list with one result per element or row in X.
Details
By default, the parallel package is used for parallel computation, however an option exists to use the future package instead.
Examples
run_parallel(list(1:3, 4:6), mean, cores = 1)
#> The run_parallel function is likely deprecated and is only kept for reference...
#> [[1]]
#> [1] 2
#>
#> [[2]]
#> [1] 5
#>
