rowMedians(x, na.rm=FALSE, dim.=dim(x), ...)
colMedians(x, na.rm=FALSE, dim.=dim(x), ...)
rowMedians()
and colMedians()
is optimized for both speed and memory.
To avoid coercing to double
s (and hence memory allocation), there
is a special implementation for integer
matrices.
That is, if x
is an integer
matrix
, then
rowMedians(as.double(x))
(rowMedians(as.double(x))
)
would require three times the memory of rowMedians(x)
(colMedians(x)
), but all this is avoided.rowMedians
() and colMedians()
for weighted medians.
For mean estimates, see rowMeans()
in colSums
().