Skip to contents

Lance-Williams updates for single, complete, average and ward.D2 (Lance and Williams 1967; Murtagh and Legendre 2014); merge matrix and heights as stats::hclust; CutTree numbers clusters by first appearance as cutree.

Usage

HierarchicalClustering(D, method = "complete")

CutTree(merge, k)

Arguments

D

Dissimilarity matrix.

method

Linkage.

merge

Merge matrix.

k

Number of groups.

Value

List or labels.

References

Murtagh, F. and Legendre, P. (2014). Ward's hierarchical agglomerative clustering method: which algorithms implement Ward's criterion? Journal of Classification 31, 274-295.

Examples

h <- HierarchicalClustering(rbind(c(0, 1, 5, 6), c(1, 0, 4, 5), c(5, 4, 0, 1), c(6, 5, 1,
  0)), "single")
CutTree(h$merge, 2)
#> [1] 1 1 2 2