| colOrderStats {DelayedMatrixStats} | R Documentation |
Gets an order statistic for each row (column) in a matrix.
colOrderStats(x, rows = NULL, cols = NULL, which, dim. = dim(x), ...) rowOrderStats(x, rows = NULL, cols = NULL, which, dim. = dim(x), ...) ## S4 method for signature 'DelayedMatrix' colOrderStats( x, rows = NULL, cols = NULL, which, dim. = dim(x), force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' rowOrderStats( x, rows = NULL, cols = NULL, which, dim. = dim(x), force_block_processing = FALSE, ... )
x |
A NxK DelayedMatrix. |
rows |
A |
cols |
A |
which |
An |
dim. |
An |
... |
Additional arguments passed to specific methods. |
force_block_processing |
|
The implementation of rowOrderStats() is optimized for both speed and
memory. To avoid coercing to doubles (and hence memory
allocation), there is a unique implementation for
integer matrices.
Returns a numeric vector of
length N (K).
This method does not handle missing values,
that is, the result corresponds to having na.rm = FALSE (if such an
argument would be available).
Peter Hickey
See rowMeans() in colSums().
# A DelayedMatrix with a 'Matrix' seed
dm_Matrix <- DelayedArray(Matrix::Matrix(c(rep(1L, 5),
as.integer((0:4) ^ 2),
seq(-5L, -1L, 1L)),
ncol = 3))
# Only using columns 2-3
colOrderStats(dm_Matrix, cols = 2:3, which = 1)
# Different algorithms, specified by `which`, may give different results
rowOrderStats(dm_Matrix, which = 1)
rowOrderStats(dm_Matrix, which = 2)