Apply: Expose an apply-loop to parallelization

Description Usage Arguments Details Author(s) See Also Examples

Description

Replacing and apply/lapply/sapply call with a Apply/Lapply/Sapply call makes it amenable to analysis by the parallelize function that can determine dynamic parallelism in running code.

Usage

1
2
3
4
Apply(X, MARGIN, FUN, ...)
Lapply(l, .f, ..., Lapply_config = Lapply_getConfig(),
       Lapply_local = Lapply_config$local, Lapply_chunk = 1)
Sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)

Arguments

X

See documentation for apply.

MARGIN

See documentation for apply.

FUN

See documentation for sapply.

simplify

See documentation for sapply.

USE.NAMES

See documentation for sapply.

.f

See documentation for lapply.

l

See documentation for lapply.

Lapply_config

See documentation for parallelize_intialize. Normally, this argument should be ignored.

Lapply_local

Force local execution. Normally, this argument should be ignored.

Lapply_chunk

Normally, this argument should be ignored.

...

See documentation for apply.

Details

Please refer to the documentation of apply/lapply/sapply for further documenation. The semantics of Apply/Lapply/Sapply are identical to apply/lapply/sapply. Using these functions implies that you want the parallelization mechanism to be applied to these loops.

Author(s)

Stefan Böhringer <r-packages@s-boehringer.org>

See Also

parallelize

Examples

1
2
3
	r0 = sapply(1:10, function(x)x^2);
	r1 = Sapply(1:10, function(x)x^2);
	print(all(r0 == r1));

Example output

Loading required package: tools
Loading required package: parallel
[1] TRUE

parallelize.dynamic documentation built on May 2, 2019, 3:45 a.m.