matrix_sparsity: sparsity percentage of a sparse matrix

Description Usage Arguments Value Examples

View source: R/utils.R

Description

sparsity percentage of a sparse matrix

Usage

1
matrix_sparsity(sparse_matrix)

Arguments

sparse_matrix

a sparse matrix

Value

a numeric value (percentage)

Examples

1
2
3
4
5
6
7
library(textTinyR)

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

sp_mat = dense_2sparse(tmp)

dbl = matrix_sparsity(sp_mat)

mlampros/textTinyR documentation built on Nov. 1, 2021, 8:44 a.m.