order.dendrogram {stats} | R Documentation |
This function returns the order (index) for the leaves in a dendrogram. These indices can then be used to access the appropriate components of any additional data.
order.dendrogram(x)
x |
A dendrogram (see as.dendrogram ). |
The indices for the leaves in left to right order are retrieved.
A vector with length equal to the number of leaves in the dendrogram is returned. Each element is the index into the original data (from which the dendrogram was computed)
R. Gentleman
set.seed(123) x <- rnorm(10) hc <- hclust(dist(x)) hc$order dd <- as.dendrogram(hc) order.dendrogram(dd)