sparsity | R Documentation |
sparsity()
estimates the percentage of entries in a given data matrix D
whose values are "practically zero". If the absolute value of an entry is
below a given threshold parameter thresh
, then that value is determined
to be "practically zero", increasing the estimated sparsity of D
. Note
that NA
values are imputed as 0 before the sparsity calculation is made.
sparsity(D, thresh = 1e-04)
D |
The input data matrix. |
thresh |
(Optional) A numeric threshold |
The sparsity of D
, measured as the percentage of entries in D
that are "practically zero".
matrix_rank()
sparsity(matrix(rep(c(1, 0), 8), 4, 4))
sparsity(matrix(0:8, 3, 3))
sparsity(matrix(0, 3, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.