# 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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab