Learn R Programming

sanic (version 0.0.2)

sparsify: Transform a Matrix to Be Sparse.

Description

Concise function to transform dense to sparse matrices of class dgCMatrix (see sparseMatrix).

Usage

sparsify(x)

Value

Returns 'x' as dgCMatrix.

Arguments

x

Numeric matrix to transform to a sparse 'dgCMatrix'.

Examples

Run this code
sparsify(matrix(rnorm(9L), 3L))

Run the code above in your browser using DataLab