sagnik ray choudhury
2012-Dec-04 21:17 UTC
[R] How do I get internal nodes of dendograms produced by R?
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? -- Sagnik Ray Choudhury sagnik@psu.edu [[alternative HTML version deleted]]
Milan Bouchet-Valat
2012-Dec-05 08:33 UTC
[R] How do I get internal nodes of dendograms produced by R?
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