1

I have a database (df) that is already clustered (Class) but I want to further group together those clusters with a hierarchical algorithm. I tried using "member" in the function hclust() but it keeps rebuilding the tree entirely

dendo <- hclust(vegdist(df, method = "euclidean"), method = "ward.D2", members = Class)
plot(dendo, labels = Class)

This gives me this tree, but I was hoping each label already grouped together (eg: all the "17" labels in one single leave or starting in the same branch):

Dendogram

enter image description here

To be clear, I'm not looking to re-order the branches but restart the clustering from a pre-set of clusters.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Alvaro dM
  • 11
  • 1
  • Use `aggregate` to compute the mean values for each variable in your clustered data and then run `hclust` on the aggregated data. Use the `members=` argument to indicate how many observations each of your pre-defined clusters has. See the Details section of the `hclust` manual page and the example using the `USArrests` data set. – dcarlson Mar 26 '21 at 04:23
  • Thank you so much. I read the details section of ```hclust``` but completely misunderstood the use of ```members```. Now I do and ```aggregate``` worked. – Alvaro dM Mar 26 '21 at 23:18

0 Answers0