Convert Sparse Matrix to Full Matrix - R

Am I looking for an efficient way to convert a huge sparse matrix into a full matrix (and not a data frame) in R?

Any idea?

Thank.

+4
source share
1 answer

We can use as.matrix

m1 <- as.matrix(sM)

where sMis the sparse matrix.

We can check methods

grep("as.matrix", methods(class = "sparseMatrix"), value = TRUE)
#[1] "as.matrix,Matrix-method"
+1
source

All Articles