【发布时间】:2013-06-09 21:38:21
【问题描述】:
我想创建一个带有水平标签的树状图,但是让叶子根据它们的高度悬挂,而不是仅仅下降到图的边缘。
例子:
par(mfrow = c(1,2))
hc <- hclust(dist(USArrests), "ave")
plot(hc) # a plot with hanging branches
plot(as.dendrogram(hc), horiz = TRUE) # a horizontal plot, but the branches are not hanging
关于如何编程有什么建议吗?
谢谢。
【问题讨论】:
-
我认为您可以使用
?dendrogram中的最后一个示例做一些接近此的事情。 -
嗨,费迪南德,我承认我不知道怎么做。你能扩展你的想法吗?
-
使用
edgetext属性,使用dendrapply为每条边设置。这只是一个想法,我现在没有时间去追求这个。 :-( -
Have you seen this?它遍历
lattice和ggplot2中的树状图。
标签: r dendrogram hclust dendextend