nClusters | R Documentation |
Count the Number of Clusters in a Set Partition
nClusters(partition)
partition |
A numeric vector representing a partition of the integers 1, ..., n using cluster labels |
The number of clusters in the given set partition as a numeric vector of length one.
p <- c(0,1,1,2,3,2,4,4,2) nClusters(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.