Closed jayhesselberth closed 6 years ago
My preference would be to use Matrix
as it is a more commonly used format and it seems that the slam
format isn't appreciably smaller for these data types.
library(Seurat)
library(slam)
# sparseMatrix from Matrix
print(object.size(Seurat::pbmc_small@raw.data), unit = "Kb")
#> 91.3 Kb
slam_mat <- as.simple_triplet_matrix(Seurat::pbmc_small@raw.data)
# sparseMatrix from slam
print(object.size(slam_mat), unit = "Kb")
#> 91.1 Kb
Created on 2018-11-07 by the reprex package (v0.2.1)
Got it.
PS Nice headshot!
Should we use
slam
instead ofMatrix
for sparse matrices? Sparse matrices in slam are (can be?) smaller.http://www.johnmyleswhite.com/notebook/2011/10/31/using-sparse-matrices-in-r/