toCsparse {beachmat} | R Documentation |
Exactly what it says in the title.
toCsparse(x)
x |
Any object produced by block processing with |
This is intended for use inside functions to be passed to colBlockApply
or rowBlockApply
.
The idea is to pre-process blocks for user-defined functions that don't know how to deal with SparseArraySeed objects,
which is often the case for R-defined functions that do not benefit from beachmat's C++ abstraction.
x
is returned unless it was a SparseArraySeed,
in which case an appropriate CsparseMatrix object is returned instead.
Aaron Lun
library(DelayedArray) out <- SparseArraySeed(c(10, 10), nzindex=cbind(1:10, sample(10)), nzdata=runif(10)) toCsparse(out)