lapply: Apply Functions Over "matter" Lists

Description Usage Arguments Details Value Author(s) See Also Examples

Description

An implementation of lapply and sapply for matter_list objects.

Usage

1
2
3
4
5
6
## S4 method for signature 'matter_list'
lapply(X, FUN, ..., BPPARAM = bpparam())

## S4 method for signature 'matter_list'
sapply(X, FUN, ..., BPPARAM = bpparam(),
	simplify = TRUE, USE.NAMES = TRUE)

Arguments

X

A matter list-like object.

FUN

The function to be applied.

...

Additional arguments to be passed to FUN.

simplify

Should the result be simplified into a vector, matrix, or higher dimensional array?

USE.NAMES

Use names(X) for the names of the answer. If X is a character, use X as names unless it has names already.

BPPARAM

An optional instance of BiocParallelParam. See documentation for bplapply.

Details

Because FUN must be executed by the interpreter in the appropriate R environment, the full list element will be loaded into memory. The chunksize of X is ignored. When performed in parallel, the matter metadata is serialized to each R session, so all workers must be able to access the data via the same paths().

Value

See lapply for details.

Author(s)

Kylie A. Bemis

See Also

lapply

Examples

1
2
3
4
5
6
7
register(SerialParam())

x <- matter_list(list(1:10, b=11:20, 21:30), names=c("a", "b", "c"))

lapply(x, sum)

sapply(x, sum)

matter documentation built on Nov. 8, 2020, 6:15 p.m.