[R] How to retrieve pairwise distances between clusters after cutting the tree?

Naxerova, Kamila naxerova at fas.harvard.edu
Tue Aug 6 19:59:49 CEST 2013


Dear all,

what would be the best way of retrieving distances between individual clusters after cutting my tree of interest? $height from the hclust object will give me the distance between clusters at a each agglomeration step, but let's say I have a situation where I have six observations A, B, C, D, E, F. The clustering proceeds 

1) {A,B}
2) {C,D},
3) {E,F},
3) {C,D,E,F}
4) {A,B,C,D,E,F}

but now I want to know the distance between {A,B} and {E,F} which is not directly recorded in $height?

I could find the distance by locating cluster members in the original distance matrix, but is there a more direct way that I might not be aware of? Something along the lines of calc.pairwise.dist(cutree(hclust(dist),k=3))?

Many thanks in advance.
Kamila


More information about the R-help mailing list