EVOLUTION-MANAGER
Edit File: reorder.dendrogram.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Reorder a Dendrogram</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for reorder.dendrogram {stats}"><tr><td>reorder.dendrogram {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Reorder a Dendrogram</h2> <h3>Description</h3> <p>A method for the generic function <code><a href="reorder.factor.html">reorder</a></code>. </p> <p>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. </p> <h3>Usage</h3> <pre> ## S3 method for class 'dendrogram' reorder(x, wts, agglo.FUN = sum, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the (dendrogram) object to be reordered</p> </td></tr> <tr valign="top"><td><code>wts</code></td> <td> <p>numeric weights (arbitrary values) for reordering.</p> </td></tr> <tr valign="top"><td><code>agglo.FUN</code></td> <td> <p>a function for weights agglomeration, see below.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments</p> </td></tr> </table> <h3>Details</h3> <p>Using the weights <code>wts</code>, the leaves of the dendrogram are reordered so as to be in an order as consistent as possible with the weights. At each node, the branches are ordered in increasing weights where the weight of a branch is defined as <i>f(w_j)</i> where <i>f</i> is <code>agglo.FUN</code> and <i>w_j</i> is the weight of the <i>j</i>-th sub branch. </p> <h3>Value</h3> <p>A dendrogram where each node has a further attribute <code>value</code> with its corresponding weight. </p> <h3>Author(s)</h3> <p>R. Gentleman and M. Maechler</p> <h3>See Also</h3> <p><code><a href="reorder.factor.html">reorder</a></code>. </p> <p><code><a href="dendrogram.html">rev.dendrogram</a></code> which simply reverses the nodes' order; <code><a href="heatmap.html">heatmap</a></code>, <code><a href="cophenetic.html">cophenetic</a></code>. </p> <h3>Examples</h3> <pre> require(graphics) set.seed(123) x <- rnorm(10) hc <- hclust(dist(x)) dd <- as.dendrogram(hc) dd.reorder <- reorder(dd, 10:1) plot(dd, main = "random dendrogram 'dd'") op <- par(mfcol = 1:2) plot(dd.reorder, main = "reorder(dd, 10:1)") plot(reorder(dd, 10:1, agglo.FUN = mean), main = "reorder(dd, 10:1, mean)") par(op) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>