powered by
This function returns the number of factor in each column of a categorical matrix.
ncat(Xcat)
A row vector that contains the number of categories in each column.
A matrix of integers that contains categorical vector in each column.
Raphaël Jauslin raphael.jauslin@unine.ch
Xcat <- matrix(c(sample(x = 1:6, size = 100, replace = TRUE), sample(x = 1:6, size = 100, replace = TRUE), sample(x = 1:6, size = 100, replace = TRUE)),ncol = 3) ncat(Xcat)
Run the code above in your browser using DataLab