hclass: Classifications from Hierarchical Agglomeration

Description Usage Arguments Value See Also Examples

View source: R/mbahc.R

Description

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

Usage

1
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.

See Also

hc, hcE

Examples

1
2
3
4
5
6
7
8
9
hcTree <- hc(modelName="VVV", data = iris[,-5])
cl <- hclass(hcTree,c(2,3))

## Not run: 
par(pty = "s", mfrow = c(1,1))
clPairs(iris[,-5],cl=cl[,"2"])
clPairs(iris[,-5],cl=cl[,"3"])

## End(Not run)

Example output

Package 'mclust' version 5.4.3
Type 'citation("mclust")' for citing this R package in publications.

mclust documentation built on Nov. 20, 2020, 5:09 p.m.