Learn R Programming

mclust (version 2.1-14)

hclass: Classifications from Hierarchical Agglomeration

Description

Determines the classifications corresponding to different numbers of groups given merge pairs from hierarchical agglomeration.

Usage

hclass(hcPairs, G)

Arguments

hcPairs
A numeric two-column matrix in which the ith row gives the minimum index for observations in each of the two clusters merged at the ith stage of agglomerative hierarchical clustering.
G
An integer or vector of integers giving the number of clusters for which the corresponding classfications are wanted.

Value

  • A matrix with length(G) columns, each column corresponding to a classification. Columns are indexed by the character representation of the integers in G.

References

C. Fraley and A. E. Raftery (2002b). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.

See Also

hc, hcE

Examples

Run this code
data(iris)
irisMatrix <- iris[,1:4]

hcTree <- hc(modelName="VVV", data = irisMatrix)
cl <- hclass(hcTree,c(2,3))

par(pty = "s", mfrow = c(1,1))
clPairs(irisMatrix,cl=cl[,"2"])
clPairs(irisMatrix,cl=cl[,"3"])

Run the code above in your browser using DataLab