mapdims: Map over matrix dimensions separately in a single function...

Description Usage Arguments Details Value See Also Examples

View source: R/mapdims.R

Description

Map over matrix dimensions separately in a single function call

Usage

1
2
3
mapdims(f, x, ...)
mapc(f, x)
mapr(f, x)

Arguments

f

A function to apply to the 2D dataset.

x

A dataset, such as an array or data frame.

...

Arguments passed to the f.

Details

Apply function over dimensions and save the column- and row-wise results separately in a list with 'mapdims()'; convenient 'apply()' abbreviations with 'mapc()' and 'mapr()'.

Value

List for mapdims(). Two elements: rowwise for the row-wise computations, and colwise for the column-specific results. Output is array for 'mapc()' and 'mapr()'

See Also

https://github.com/robertschnitman/afp, apply

Examples

1
2
3
4

robertschnitman/afp documentation built on Aug. 9, 2020, 9:46 a.m.