bplapply {BiocParallel} | R Documentation |
Parallel lapply-like functionality
Description
bplapply
applies FUN
to each element of X
. Any
type of object X
is allowed, provided length
, [
,
and [[
methods are available. The return value is a list
of length equal to X
, as with lapply
.
Usage
bplapply(X, FUN, ..., BPREDO = list(), BPPARAM=bpparam(), BPOPTIONS = bpoptions())
Arguments
X |
Any object for which methods |
FUN |
The |
... |
Additional arguments for |
BPPARAM |
An optional |
BPREDO |
A |
BPOPTIONS |
Additional options to control the behavior of the parallel evaluation, see |
Details
See methods{bplapply}
for additional methods, e.g.,
method?bplapply("MulticoreParam")
.
Value
See lapply
.
Author(s)
Martin Morgan mailto:mtmorgan@fhcrc.org. Original code as
attributed in mclapply
.
See Also
-
bpvec
for parallel, vectorized calculations. -
BiocParallelParam
for possible values ofBPPARAM
.
Examples
methods("bplapply")
## ten tasks (1:10) so ten calls to FUN default registered parallel
## back-end. Compare with bpvec.
fun <- function(v) {
message("working") ## 10 tasks
sqrt(v)
}
bplapply(1:10, fun)