nClusters: Count the Number of Clusters in a Set Partition

View source: R/summary.R

nClustersR Documentation

Count the Number of Clusters in a Set Partition

Description

Count the Number of Clusters in a Set Partition

Usage

nClusters(partition)

Arguments

partition

A numeric vector representing a partition of the integers 1, ..., n using cluster labels

Value

The number of clusters in the given set partition as a numeric vector of length one.

Examples


p <- c(0,1,1,2,3,2,4,4,2)
nClusters(p)

sams documentation built on April 20, 2022, 1:06 a.m.

Related to nClusters in sams...