View source: R/dend_as_hclist.R
dend_as_hclist | R Documentation |
This function transforms a dendrogram into a hc_list object
dend_as_hclist(dend)
dend |
An object of class |
A list object of length-num_interior_nodes
. The i
-th item in the list contains the child nodes of the i
-th node in the tree. The negative values in the list indicate leaf nodes, and positive values indicate interior node. The interior nodes are numbered reversely from the root along the branch, i.e., the number corresponding to a node is always smaller than the number corresponding to its parent.
hc_list |
The list object that represents the tree structure, |
hc <- hclust(dist(USArrests), "ave")
dend = as.dendrogram(hc)
dah = dend_as_hclist(dend)
## check length of the list
length(dah)
## leaf labels
attr(dah, "leaf_labels")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.