colAvgsPerRowSet,DelayedMatrix-method {DelayedMatrixStats} | R Documentation |
Calculates for each row (column) a summary statistic for equally sized subsets of columns (rows).
## S4 method for signature 'DelayedMatrix' colAvgsPerRowSet( X, W = NULL, cols = NULL, S, FUN = colMeans, ..., force_block_processing = FALSE, na.rm = NA, tFUN = FALSE ) ## S4 method for signature 'DelayedMatrix' rowAvgsPerColSet( X, W = NULL, rows = NULL, S, FUN = rowMeans, ..., force_block_processing = FALSE, na.rm = NA, tFUN = FALSE )
X |
A NxM DelayedMatrix. |
W |
An optional numeric |
cols |
A |
S |
An integer |
FUN |
A row-by-row (column-by-column) summary statistic function. It is
applied to to each column (row) subset of |
... |
Additional arguments passed to specific methods. |
force_block_processing |
|
na.rm |
(logical) Argument passed to |
tFUN |
If |
rows |
A |
The S4 methods for x
of type matrix
,
array
, or numeric
call
matrixStats::rowAvgsPerColSet
/ matrixStats::colAvgsPerRowSet
.
Returns a numeric JxN
(MxJ
) matrix.
Peter Hickey
matrixStats::rowAvgsPerColSet()
and matrixStats::colAvgsPerRowSet()
which are used when the input is a matrix
or numeric
vector.
# A DelayedMatrix with a 'DataFrame' seed dm_DF <- DelayedArray(S4Vectors::DataFrame(C1 = rep(1L, 5), C2 = as.integer((0:4) ^ 2), C3 = seq(-5L, -1L, 1L))) colAvgsPerRowSet(dm_DF, S = matrix(1:2, ncol = 2)) rowAvgsPerColSet(dm_DF, S = matrix(1:2, ncol = 1))