Closed EOneita closed 8 years ago
Good question. The function you are looking for is dendextend::plot_horiz.dendrogram
. This function is indeed not documented in the vignettes, although it is used by tanglegram. Here is an example for how to use it, I hope this helps:
hc <- hclust(dist(USArrests), "ave")
d <- as.dendrogram(hc)
plot(d, horiz = TRUE)
library(dendextend)
d <- d %>% color_branches(k=3) %>% color_labels
par(mar = c(3,7,1,1))
plot_horiz.dendrogram(d, side = TRUE)
Output
With regards, Tal
Great, thank you so much! Worked like a charm.
I have attached the image of the dendrogram I have created. Is there a code in ddextend that can be used to mirror this image? So, I would have the questions on the left, and the tree extending to the left, as an inverse of what is seen here.
I've been looking through the ddextend manual for code to this effect, but have struggled to find any.
Thank you in advance for your help, Elizabeth