Learn R Programming

matrixStats (version 0.12.2)

rowIQRs: Estimates of the interquartile range for each row (column) in a matrix

Description

Estimates of the interquartile range for each row (column) in a matrix.

Usage

rowIQRs(x, ...)
 colIQRs(x, ...)

Arguments

x
...
Additional arguments passed to rowQuantiles() (colQuantiles()).

Value

See Also

See IQR. See rowSds().

Examples

Run this code
set.seed(1)

x <- matrix(rnorm(50*40), nrow=50, ncol=40)
str(x)

# Row IQRs
q <- rowIQRs(x)
print(q)
q0 <- apply(x, MARGIN=1, FUN=IQR)
stopifnot(all.equal(q0, q))

# Column IQRs
q <- colIQRs(x)
print(q)
q0 <- apply(x, MARGIN=2, FUN=IQR)
stopifnot(all.equal(q0, q))

Run the code above in your browser using DataLab