Estimates quantiles for each row (column) in a matrix.

1 2 | ```
rowQuantiles(x, probs=seq(from = 0, to = 1, by = 0.25), ..., drop=TRUE)
colQuantiles(x, ...)
``` |

`x` |
A |

`probs` |
A |

`...` |
Additional arguments passed to |

`drop` |
If TRUE, singleton dimensions in the result are dropped, otherwise not. |

Returns a `numeric`

NxJ (KxJ) `matrix`

, where
N (K) is the number of rows (columns) for which the J quantiles are
calculated.

Henrik Bengtsson

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
set.seed(1)
x <- matrix(rnorm(50*40), nrow=50, ncol=40)
str(x)
probs <- c(0.25,0.5,0.75)
# Row quantiles
q <- rowQuantiles(x, probs=probs)
print(q)
q0 <- apply(x, MARGIN=1, FUN=quantile, probs=probs)
stopifnot(all.equal(q0, t(q)))
# Column IQRs
q <- colQuantiles(x, probs=probs)
print(q)
q0 <- apply(x, MARGIN=2, FUN=quantile, probs=probs)
stopifnot(all.equal(q0, t(q)))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.