inst/examples/R/data/cluster/linkage/example_agglom.R

zfaithful <- scale(faithful)
d <- dist(zfaithful)
# hclust
cl1 <- hclust(d)
memb <- cutree(cl1, 3)
plot(zfaithful, col=memb)
# agnes
library("cluster")
cl2 <- agnes(d)
memb <- cutree(cl2, 3)
plot(zfaithful, col=memb)
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.