powered by
Concise function to transform dense to sparse matrices of class dgCMatrix (see sparseMatrix).
dgCMatrix
sparsify(x)
Returns 'x' as dgCMatrix.
Numeric matrix to transform to a sparse 'dgCMatrix'.
sparsify(matrix(rnorm(9L), 3L))
Run the code above in your browser using DataLab