to_sparse: To 'sparseMatrix'

View source: R/to_sparse.R

to_sparseR Documentation

To sparseMatrix

Description

Convert a matrix or data.frame to a sparseMatrix.

Usage

to_sparse(obj, transpose = FALSE, allow_delayed_array = TRUE, verbose = TRUE)

Arguments

obj

A single-cell object supported by scKirby. See converters for a table of all supported conversions.

transpose

Transpose the matrix with Matrix::t.

allow_delayed_array

Allow DelayedArray.

verbose

Print messages.

Value

A sparseMatrix.

Examples

obj <- data.frame(gene=paste0("gene",seq_len(10)),
                  matrix(data = 0,nrow=10,ncol = 20))
obj2 <- to_sparse(obj)

bschilder/scKirby documentation built on Oct. 2, 2024, 10:16 p.m.