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

rowRanges {matrixStats} | R Documentation

## 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`, `NA`s 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

`rowOrderStats`() and `pmin.int`().

[Package matrixStats version 0.57.0 Index]