R: Parallel, optionally verbose lapply. See ?parallel::mclapply...

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 = 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`.
`mc.allow.recursive` | Unless true, calling `mclapply` in a child process will use the child and not fork again.
`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)

[Package sccore version 1.0.1 Index]