apply: Apply Wrappers

Description Usage Arguments Details

Description

These are thin but clearer wrappers to apply(x, 1, FUN, ...) (row apply) and apply(x, 2, FUN, ...) (column apply). Intended for use with 2D R matrixs. We do a bit more work to ensure row names, column names are passed along if appropriate.

Usage

1
2
3
rowApply(X, FUN, ..., drop = TRUE)

colApply(X, FUN, ..., drop = TRUE)

Arguments

X

A matrix, or a 2D array.

FUN

The function to be applied.

...

Optional arguments to FUN.

drop

Boolean. If TRUE, we 'drop' dimensions so that results of dimension n x 1 or 1 x n are coerced to vectors.

Details

See apply for more info.


Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to apply in Kmisc...