reorder_hclust {slanter} | R Documentation |
Given a clustering of some data, and some ideal order we'd like to use to visualize it, reorder (but do not modify) the clustering to be as consistent as possible with this ideal order.
Description
Given a clustering of some data, and some ideal order we'd like to use to visualize it, reorder (but do not modify) the clustering to be as consistent as possible with this ideal order.
Usage
reorder_hclust(clusters, order)
Arguments
clusters |
The existing clustering of the data. |
order |
The ideal order we'd like to see the data in. |
Value
A reordered clustering which is consistent, wherever possible, the ideal order.
Examples
clusters <- hclust(dist(mtcars))
clusters$order
clusters <- slanter::reorder_hclust(clusters, 1:length(clusters$order))
clusters$order
[Package slanter version 0.2-0 Index]