Learn R Programming

rpgm (version 1.1.2)

colMaxs - rowMaxs - colMins - rowMins: The Maximum or Minimum of each Column or each Row of a Matrix.

Description

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

Usage

colMaxs(x)

Arguments

x

numeric or integer, matrix.

Value

A numeric vector.

Details

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

See Also

http://pgm-solutions.com/packages

Examples

Run this code
# NOT RUN {
X <- matrix(rpgm.rnorm(36), 6, 6)
colMaxs(X)
rowMaxs(X)
colMins(X)
rowMins(X)
# }

Run the code above in your browser using DataLab