Learn R Programming

textTinyR (version 1.1.8)

matrix_sparsity: sparsity percentage of a sparse matrix

Description

sparsity percentage of a sparse matrix

Usage

matrix_sparsity(sparse_matrix)

Value

a numeric value (percentage)

Arguments

sparse_matrix

a sparse matrix

Examples

Run this code

library(textTinyR)

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

sp_mat = dense_2sparse(tmp)

dbl = matrix_sparsity(sp_mat)

Run the code above in your browser using DataLab