talgalili / dendextend

Extending R's Dendrogram Functionality
153 stars 29 forks source link

set: add "leaves_branch_col" #46

Open talgalili opened 7 years ago

talgalili commented 7 years ago

library(dendextend)
by_labels_branches_col 
dend <- mtcars %>% dist %>% hclust %>% as.dendrogram
dend <- dend %>% color_labels(k=4) 
labels_colors(dend)
dend <- dend %>% set("leaves_col", labels_colors(dend))
plot(dend)

dend <- assign_values_to_leaves_edgePar(dend=dend, value = labels_colors(dend), edgePar = "col")
dend %>% plot