Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rowRanges

Gets the range of values in each row (column) of a matrix


Description

Gets the range of values in each row (column) of a matrix.

Usage

rowRanges(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

rowMins(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

rowMaxs(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

colRanges(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

colMins(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

colMaxs(x, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(x), ...)

Arguments

x

A numeric NxK matrix.

rows, cols

A vector indicating subset of rows (and/or columns) to operate over. If NULL, no subsetting is done.

na.rm

If TRUE, NAs are excluded first, otherwise not.

dim.

An integer vector of length two specifying the dimension of x, also when not a matrix.

...

Not used.

Value

rowRanges() (colRanges()) returns a numeric Nx2 (Kx2) matrix, where N (K) is the number of rows (columns) for which the ranges are calculated.

rowMins()/rowMaxs() (colMins()/colMaxs()) returns a numeric vector of length N (K).

Author(s)

Henrik Bengtsson

See Also


matrixStats

Functions that Apply to Rows and Columns of Matrices (and to Vectors)

v0.58.0
Artistic-2.0
Authors
Henrik Bengtsson [aut, cre, cph], Constantin Ahlmann-Eltze [ctb], Hector Corrada Bravo [ctb], Robert Gentleman [ctb], Jan Gleixner [ctb], Peter Hickey [ctb], Ola Hossjer [ctb], Harris Jaffee [ctb], Dongcan Jiang [ctb], Peter Langfelder [ctb], Brian Montgomery [ctb], Hugh Parsonage [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.