bg_mclapply: Multicore lapply in the background

View source: R/bg-mclapply.R

bg_mclapplyR Documentation

Multicore lapply in the background

Description

Multicore lapply in the background

Usage

bg_mclapply(X, FUN, mc.cores = 1, ..., .wait = TRUE, .seed = NULL)

Arguments

X

A list.

FUN

The function to be applied to each element of X.

mc.cores

Passed to parallel::mclapply().

...

Arguments passed to FUN.

.wait

If FALSE, the function returns immediately; if TRUE, then wait until the background job is finished.

.seed

A numeric value used to set the seed for the simulation; this is the only way to control the random number generation for your simulation.

Value

A list of output data.

Examples

ans <- bg_mclapply(seq(10), sqrt, mc.cores = 2)


mrgsim.parallel documentation built on March 18, 2022, 7:52 p.m.