Skip to content
Prev 280008 / 398506 Next

Is there a way to print branch distances for hclust function?

On Sun, Dec 11, 2011 at 8:43 PM, kbrownk <kbrownk at gmail.com> wrote:
You need to dig a bit deeper in the help file :) The return value is a
list that contains, among others, components
'merge' and 'height'. The 'merge' component tells you which objects
were merged at each particular step, and the 'height' component tells
you what the merging height at that step was. The (slightly) tricky
part is to relate the merge component to actual objects - AFAIK there
is no function for that. The function cutree() using the argument k
and varying it between 2 and n should basically do it for you but you
need to match it to the entries in 'merge'. Maybe someone else knows a
better way to do this.

HTH,

Peter