plapply {sccore} | R Documentation |
Parallel, optionally verbose lapply. See ?parallel::mclapply for more info.
Description
Parallel, optionally verbose lapply. See ?parallel::mclapply for more info.
Usage
plapply(
...,
progress = FALSE,
n.cores = parallel::detectCores(),
mc.preschedule = FALSE,
mc.allow.recursive = TRUE,
fail.on.error = FALSE
)
Arguments
... |
Additional arguments passed to mclapply(), lapply(), or pbmcapply::pbmclapply() |
progress |
Show progress bar via pbmcapply::pbmclapply() (default=FALSE). |
n.cores |
Number of cores to use (default=parallel::detectCores()). When n.cores=1, regular lapply() is used. Note: doesn't work when progress=TRUE |
mc.preschedule |
if set to |
mc.allow.recursive |
boolean Unless true, calling mclapply in a child process will use the child and not fork again (default=TRUE) |
fail.on.error |
boolean Whether to fail and report and error (using stop()) as long as any of the individual tasks has failed (default =FALSE) |
Value
list, as returned by lapply
Examples
square = function(x){ x**2 }
plapply(1:10, square, n.cores=1, progress=TRUE)