powered by
Computes the cardinality (the number of non-zero elements) of each column of the matrix \(\mathbf{w}\).
colCardinalities(w)
A vector containing the number of non-zero elements of each column of w
w
a numeric matrix, e.g. xcoef as returned by nscancor
xcoef
nscancor
# returns c(2, 1) colCardinalities(matrix(c(1, 0, 2, -1, 0, 0), ncol = 2))
Run the code above in your browser using DataLab