Automate cluster number selection using Silhouette Width

autoK(d, hc, max_k)

Arguments

d

A dist object.

hc

A hclust object.

max_k

The maximal k.

Value

The best k number.

Examples

x <- matrix(rnorm(100), nrow = 5)
d <- dist(x)
hc <- hclust(d)
autoK(d, hc)