get_leaves_edgePar | R Documentation |
This is helpful to get the attributes of branches of the leaves. For example, after we use color_branches, to get the colors of the labels to match (since getting the colors of branches to match those of the labels can be tricky).
get_leaves_edgePar(dend, simplify = FALSE, ...)
dend |
a dendrogram object |
simplify |
logical (default is FALSE). If TRUE, then the return vector is
after using |
... |
not used |
A list (or a vector) with the dendrogram's leaves edgePar attribute
get_nodes_attr, assign_values_to_leaves_nodePar, labels_colors get_leaves_nodePar
# define dendrogram object to play with:
hc <- hclust(dist(USArrests[1:5, ]), "ave")
dend <- as.dendrogram(hc)
# get_leaves_edgePar(dend) # error :)
get_leaves_edgePar(dend)
dend <- color_branches(dend, k = 3)
get_leaves_edgePar(dend)
get_leaves_edgePar(dend, TRUE)
dend <- dend %>% set("branches_lwd", c(2, 1, 2))
get_leaves_edgePar(dend)
plot(dend)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.