powered by
Count the Number of Clusters in a Set Partition
nClusters(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.
# NOT RUN { p <- c(0,1,1,2,3,2,4,4,2) nClusters(p) # }
Run the code above in your browser using DataLab