matrix_sparsity {textTinyR}R Documentation

sparsity percentage of a sparse matrix

Description

sparsity percentage of a sparse matrix

Usage

matrix_sparsity(sparse_matrix)

Arguments

sparse_matrix

a sparse matrix

Value

a numeric value (percentage)

Examples


library(textTinyR)

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

sp_mat = dense_2sparse(tmp)

dbl = matrix_sparsity(sp_mat)

[Package textTinyR version 1.1.8 Index]