sccore (version 0.1.2)

plapply: 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,
  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 TRUE then the computation is first divided to (at most) as many jobs are there are cores and then the jobs are started, each job possibly covering more than one value. If set to FALSE then one job is forked for each value of X. The former is better for short computations or large number of values in X, the latter is better for jobs that have high variance of completion time and not too many values of X compared to mc.cores.

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

Run this code
# NOT RUN {
square = function(x){ x**2 }
plapply(1:10, square, n.cores=1, progress=TRUE)

# }

Run the code above in your browser using DataCamp Workspace