powered by
Check if an object is a sparse matrix
is_sparse(x)
An object to test
library(Matrix) is_sparse(matrix(1:10)) # FALSE is_sparse(Matrix::rsparsematrix(100, 200, .01)) # TRUE
Run the code above in your browser using DataLab