c.apply: Portable apply function

Description Usage Arguments Examples

Description

Wrapper function for clusterApply(), Rhpc_lapply(), and an implementation of 'mcapply'.

Usage

1
2
## S3 method for class 'apply'
c(X, MARGIN, FUN, ...)

Arguments

X

an object with dim > 1, each element of which is individually passed to FUN

MARGIN

either 1 for row and 2 for column.

FUN

a function object, takes X as first argument

...

other arguments, possibly named, to be passed to every iteration of FUN

Examples

1
2
3
mat <- matrix(1:12, 3, 4)
c.apply(mat, 1, sum)	# a parallel implementation of rowSums
                     # Note that the serial version is likely faster for this function

bamonroe/ctools documentation built on May 11, 2019, 6:19 p.m.