 <code><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></code> works for numeric vectors).</p>
<p><code><a href="https://rdrr.io/r/stats/dendrogram.html" class="external-link">rev.dendrogram</a></code> is part of base R, and returns the tree object
after rotating it so that the order of the labels is reversed.
Here we added an S3 method for hclust objects.</p>
<p>The <code>sort</code> methods sort the labels of the tree (using <code>order</code>)
and then attempts to rotate the tr