EVOLUTION-MANAGER
Edit File: rect.hclust.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: Draw Rectangles Around Hierarchical Clusters</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 rect.hclust {stats}"><tr><td>rect.hclust {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Draw Rectangles Around Hierarchical Clusters</h2> <h3>Description</h3> <p>Draws rectangles around the branches of a dendrogram highlighting the corresponding clusters. First the dendrogram is cut at a certain level, then a rectangle is drawn around selected branches. </p> <h3>Usage</h3> <pre> rect.hclust(tree, k = NULL, which = NULL, x = NULL, h = NULL, border = 2, cluster = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>tree</code></td> <td> <p>an object of the type produced by <code>hclust</code>.</p> </td></tr> <tr valign="top"><td><code>k, h</code></td> <td> <p>Scalar. Cut the dendrogram such that either exactly <code>k</code> clusters are produced or by cutting at height <code>h</code>.</p> </td></tr> <tr valign="top"><td><code>which, x</code></td> <td> <p>A vector selecting the clusters around which a rectangle should be drawn. <code>which</code> selects clusters by number (from left to right in the tree), <code>x</code> selects clusters containing the respective horizontal coordinates. Default is <code>which = 1:k</code>.</p> </td></tr> <tr valign="top"><td><code>border</code></td> <td> <p>Vector with border colors for the rectangles.</p> </td></tr> <tr valign="top"><td><code>cluster</code></td> <td> <p>Optional vector with cluster memberships as returned by <code>cutree(hclust.obj, k = k)</code>, can be specified for efficiency if already computed.</p> </td></tr> </table> <h3>Value</h3> <p>(Invisibly) returns a list where each element contains a vector of data points contained in the respective cluster.</p> <h3>See Also</h3> <p><code><a href="hclust.html">hclust</a></code>, <code><a href="identify.hclust.html">identify.hclust</a></code>. </p> <h3>Examples</h3> <pre> require(graphics) hca <- hclust(dist(USArrests)) plot(hca) rect.hclust(hca, k = 3, border = "red") x <- rect.hclust(hca, h = 50, which = c(2,7), border = 3:4) x </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>