rowIQRs | R Documentation |
Estimates of the interquartile range for each row (column) in a matrix.
rowIQRs(x, rows = NULL, cols = NULL, na.rm = FALSE, ...,
useNames = TRUE)
colIQRs(x, rows = NULL, cols = NULL, na.rm = FALSE, ...,
useNames = TRUE)
iqr(x, idxs = NULL, na.rm = FALSE, ...)
x |
An NxK |
rows |
A |
cols |
A |
na.rm |
If |
... |
Additional arguments passed to |
useNames |
If |
idxs |
A |
Returns a numeric
vector
of
length N (K).
Contrary to IQR
, which gives
an error if there are missing values and na.rm = FALSE
, iqr()
and its corresponding row and column-specific functions return
NA
_real_.
Henrik Bengtsson
See IQR
. See rowSds
().
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.