pkgdown/header.html

Skip to contents

Converts a dgCMatrix or dgRMatrix into a scipy.sparse matrix, using csc_array/csr_array if available, else csc_matrix/csr_matrix.

Usage

convert_to_scipy_sparse(mat, scipy)

Arguments

mat

A dgCMatrix or dgRMatrix.

scipy

The scipy.sparse Python module (already imported).

Value

A reticulate Python object representing the sparse matrix.