Row and column summary methods for adgCMatrix
Source:R/methods-sparse.R
rowcol-summary-sparse-methods.RdCompute row or column sums and means for a sparse adgCMatrix,
dispatching through the amatrix backend when GPU acceleration is
available.
Examples
sp <- as(matrix(c(1, 0, 2, 0, 3, 0), 2, 3), "dgCMatrix")
A <- adgCMatrix(sp)
rowSums(A)
#> [1] 6 0
colMeans(A)
#> [1] 0.5 1.0 1.5