I am looking for an efficient way to convert a huge sparse matrix to a full matrix (not to a dataframe) in R?
Any idea?
Thanks.
We can use as.matrix
m1 <- as.matrix(sM)
where sM
is the sparse matrix.
We can check the methods
grep("as.matrix", methods(class = "sparseMatrix"), value = TRUE)
#[1] "as.matrix,Matrix-method"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With