colMaxs: The Maximum or Minimum of each Column or each Row of a...

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

View source: R/rowMaxs.R

Description

For row and column maxs and mins for numeric arrays (or data frames).

Usage

1

Arguments

x

numeric or integer, matrix.

Details

These functions are equivalent, per example for colMaxs(X), to apply(X, 1, max), but are a lot faster.

Value

A numeric vector.

Author(s)

Nicolas Baradel - PGM Solutions

See Also

http://pgm-solutions.com/packages

Examples

1
2
3
4
5
X <- matrix(rpgm.rnorm(36), 6, 6)
colMaxs(X)
rowMaxs(X)
colMins(X)
rowMins(X)

Example output

[1] 1.750785 0.124235 1.812266 1.414379 2.383335 1.633112
[1]  1.3255710 -0.5151167  2.3833354  1.8122658  1.4143792 -0.0359957
[1] -0.9230404 -2.1890829 -1.4252961 -1.9511022 -1.1263699 -2.0768940
[1] -2.0768940 -2.1890829 -1.0990014 -0.9091303 -1.1263699 -1.4252961

rpgm documentation built on March 18, 2018, 2:24 p.m.