[R] use hjust or vjust with dendextend

Sergio Fonda sergio.fonda99 at gmail.com
Sun Apr 17 21:09:31 CEST 2016

Following "Introduction to dendextend" from Tal Galili, I applied this
code on iris data:
dend2 <- iris[1:30,-5] %>% dist %>% hclust %>% as.dendrogram %>%
set("branches_k_color", k=3) %>% set("branches_lwd", rep(1,4)) %>%
set("branches_lty", rep(1,6))  %>%   set("labels_colors") %>%
set("labels_cex", c(1.0,1.0)) %>%   set("nodes_pch", 19) %>%
set("nodes_col", c("orange", "black", "plum", NA))
ggd2 <- as.ggdend(dend2)
ggplot(ggd2, horiz = TRUE, theme = NULL)

My problem is that the labels overlap the dendogram leafs and I have no
idea on how parameter hjust or vjust may be used to create space between
label and leaf.

Thanks for any help,

	[[alternative HTML version deleted]]

More information about the R-help mailing list