| reorder {mva} | R Documentation |
Reorder a dendrogram
Description
There are many different orderings of a dendrogram that are consistent with the structure imposed. This function takes a dendrogram and a vector of values and reorders the dendrogram in the order of the supplied vector, maintaining the constraints on the dendrogram.
Usage
reorder(x, ...)
reorder.dendrogram(x, wts, ...)
Arguments
x |
The object to be reordered |
wts |
The weights for reordering. |
... |
additional arguments |
Details
Using the weights the leaves of the dendrogram are reordered so as to be in an order as consistent as possible with the weights.
Value
From reorder.dendrogram a dendrogram.
Author(s)
R. Gentleman
See Also
heatmap, cophenetic
Examples
set.seed(123)
x <- rnorm(10)
hc <- hclust(dist(x))
dd <- as.dendrogram(hc)
dd.reorder <- reorder(dd, 10:1)