[R] How do I get internal nodes of dendograms produced by R?

Milan Bouchet-Valat nalimilan at club.fr
Wed Dec 5 09:33:49 CET 2012


Le mardi 04 décembre 2012 à 16:17 -0500, sagnik ray choudhury a écrit :
> I am using R for hierarchical clustering of a number of documents.
> 
> I have a distance matrix on which I have applied hclust method. When I plot
> the result of hclust method, I can see the dendogram plotted. What I need
> now is the dendogram stored as a tree in a data structure. My goal is to
> automatically label all internal nodes. For that, I need to know, which
> leaf nodes make a first level cluster, and which first level clusters make
> a second level cluster and so on. Is there a way in R to get this
> information?
You probably want to convert you 'hclust' object to a 'dendrogram'
object using as.dendrogram(), and work with that tree. See ?dendrogram,
in particular the "Details" section.


My two cents




More information about the R-help mailing list