ClusterCount: ClusterCount

View source: R/ClusterCount.R

ClusterCountR Documentation

ClusterCount

Description

Calculates cluster counts and percentages.

Usage

ClusterCount(Cls,Ordered=TRUE,NonFinite=9999)

Arguments

Cls

1:n numerical vector of numbers defining the classification as the main output of the clustering algorithm for the n cases of data. It has k unique numbers representing the arbitrary labels of the clustering.

Ordered

Optional logical scalar. If TRUE, the output is ordered increasingly by the labels in UniqueClusters.

NonFinite

Optional scalar used to replace non-finite values in Cls.

Details

When Ordered = FALSE, output order is determined by the first occurrence of each cluster label in Cls.

Non-numeric vectors are supported. In that case, Cls is converted with as.character(), a warning is issued, and the statistics are computed.

Value

UniqueClusters

A numerical vector containing the k unique cluster labels in Cls.

CountPerCluster

A named vector of length k containing the number of observations in each cluster. Its names are UniqueClusters.

NumberOfClusters

The number of clusters, k.

ClusterPercentages

A numerical vector of length k containing the percentage of observations in each cluster.

Author(s)

Michael Thrun

Examples

data('Hepta')
Cls=Hepta$Cls
ClusterCount(Cls)

FCPS documentation built on Oct. 3, 2026, 9:06 a.m.