NaArray col/row summarization
NaArray-matrixStats.Rd
EXPERIMENTAL!!!
The SparseArray package provides memory-efficient col/row
summarization methods (a.k.a. matrixStats methods) for NaArray
objects, like colSums()
, rowSums()
, colMeans()
,
rowMeans()
, etc...
Note that these are S4 generic functions defined in the MatrixGenerics package, with methods for ordinary matrices defined in the matrixStats package. This man page documents the methods defined for NaArray objects.
IMPORTANT NOTE: This is WORK-IN-PROGRESS! All the col*()
methods
listed below are supported. However, among the row*()
methods,
only rowAnyNAs()
, rowMins()
, rowMaxs()
,
rowRanges()
, rowSums()
, and rowSums2()
are
supported on NaArray objects at the moment.
Usage
## N.B.: Showing ONLY the col*() methods (usage of row*() methods is
## the same):
# S4 method for class 'NaArray'
colAnyNAs(x, rows=NULL, cols=NULL, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colAnys(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colAlls(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colMins(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colMaxs(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colRanges(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colSums(x, na.rm=FALSE, dims=1)
# S4 method for class 'NaArray'
colProds(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colMeans(x, na.rm=FALSE, dims=1)
# S4 method for class 'NaArray'
colSums2(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colMeans2(x, rows=NULL, cols=NULL, na.rm=FALSE, dims=1, ..., useNames=NA)
# S4 method for class 'NaArray'
colVars(x, rows=NULL, cols=NULL, na.rm=FALSE, center=NULL, dims=1,
..., useNames=NA)
# S4 method for class 'NaArray'
colSds(x, rows=NULL, cols=NULL, na.rm=FALSE, center=NULL, dims=1,
..., useNames=NA)
Arguments
- x
- rows, cols, ...
Not supported.
- na.rm, useNames, center
See man pages of the corresponding generics in the MatrixGenerics package (e.g.
?MatrixGenerics::colVars
) for a description of these arguments.Note that, unlike the methods for ordinary matrices defined in the matrixStats package, the
center
argument of thecolVars()
,rowVars()
,colSds()
, androwSds()
methods for SparseArray objects can only be a single value (or aNULL
). In particular, ifx
has more than one column, thencenter
cannot be a vector with one value per column inx
.- dims
See
?base::colSums
for a description of this argument.
Details
These methods are typically used with na.rm=TRUE
when called
on an NaMatrix or NaArray object.
All these methods operate natively on the NaArray internal representation, for maximum efficiency.
Note that more col/row summarization methods might be added in the future.
Value
See man pages of the corresponding generics in the MatrixGenerics
package (e.g. ?MatrixGenerics::colRanges
)
for the value returned by these methods.
Note
Most col*()
methods for NaArray objects are multithreaded.
See set_SparseArray_nthread
for how to control the number
of threads.
See also
NaArray objects.
The man pages of the various generic functions defined in the MatrixGenerics package e.g.
MatrixGenerics::colVars
etc...