Learn R Programming

dendextend (version 1.18.1)

get_leaves_edgePar: Get edgePar of dendrogram's leaves

Description

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).

Usage

get_leaves_edgePar(dend, simplify = FALSE, ...)

Value

A list (or a vector) with the dendrogram's leaves edgePar attribute

Arguments

dend

a dendrogram object

simplify

logical (default is FALSE). If TRUE, then the return vector is after using unlist on it.

...

not used

See Also

get_nodes_attr, assign_values_to_leaves_nodePar, labels_colors get_leaves_nodePar

Examples

Run this code
# 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)

Run the code above in your browser using DataLab