dense_2sparse: convert a dense matrix to a sparse matrix

Description Usage Arguments Value Examples

View source: R/utils.R

Description

convert a dense matrix to a sparse matrix

Usage

1
dense_2sparse(dense_mat)

Arguments

dense_mat

a dense matrix

Value

a sparse matrix

Examples

1
2
3
4
5
library(textTinyR)

tmp = matrix(sample(0:1, 100, replace = TRUE), 10, 10)

sp_mat = dense_2sparse(tmp)

textTinyR documentation built on Oct. 26, 2021, 9:06 a.m.