R - Hierarchical Clustering
About
Steps
Data Generation
Apply Model
Method
Complete
hc.complete=hclust(dist(xclustered),method="complete")
plot(hc.complete)
Single
hc.single=hclust(dist(xclustered),method="single")
plot(hc.single)
Average
hc.average=hclust(dist(xclustered),method="average")
plot(hc.average)
Cut the tree
The function cutree cut the tree at level 4.
hc.cut=cutree(hc.complete,4)
It will produce a vector of numbers from 1 to 4, saying which branch each observation is on.