colCardinalities | R Documentation |
Computes the cardinality (the number of non-zero elements) of each column of
the matrix \mathbf{w}
.
colCardinalities(w)
w |
a numeric matrix, e.g. |
A vector containing the number of non-zero elements of each column of w
# returns c(2, 1)
colCardinalities(matrix(c(1, 0, 2, -1, 0, 0), ncol = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.