sparsify: Transform a Matrix to Be Sparse.

View source: R/helpers.R

sparsifyR Documentation

Transform a Matrix to Be Sparse.

Description

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

Usage

sparsify(x)

Arguments

x

Numeric matrix to transform to a sparse 'dgCMatrix'.

Value

Returns 'x' as dgCMatrix.

Examples

sparsify(matrix(rnorm(9L), 3L))

sanic documentation built on Aug. 23, 2023, 5:08 p.m.