Extract the hierarchical structure of the nodes in a dendrogram or cluster
问题 I would like to extract the hierarchical structure of the nodes of a dendrogram or cluster. For example in the next example: library(dendextend) dend15 <- c(1:5) %>% dist %>% hclust(method = "average") %>% as.dendrogram dend15 %>% plot The nodes are classified according their position in the dendrogram (see figure below) (Figure extracted from the dendextend package's tutorial) I would like to get all the nodes for each final leaf as the next output: (the labels are ordered from left to right