Description Usage Arguments Value Examples
The function recursively finds all leaves that are descendants of a
node in an hclust
tree.
1 | find.leaves(ind, merge)
|
ind |
Index of the tree node. For an |
merge |
A ( |
Returns a sequence of indices for descendant leaves
in the leaf set {1, ..., p}. Unlike the notation used in
ind
, we use positive integers to denote leaves here.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
hc <- hclust(dist(USArrests), "ave")
# Descendant leaves of the 10th leaf (should be iteself)
find.leaves(-10, hc$merge)
# Descendant leaves of the 10th interior node
find.leaves(10, hc$merge)
# Descendant leaves of the root (should be all leaves)
ind_root <- nrow(hc$merge)
all.equal(find.leaves(ind_root, hc$merge), hc$order)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.