是否可以使用 ggdendro 仅绘制直方图的一部分。例如,如何在以下示例中仅绘制最左边的集群:
require(ggplot2)
hc <- hclust(dist(USArrests), "ave")
dhc <- as.dendrogram(hc)
ddata <- dendro_data(dhc, type="rectangle")
ggplot(segment(ddata),labels=rownames(USArrests))+
geom_segment(aes(x=x, y=y, xend=xend, yend=yend))+
theme_dendro()
额外问题:为什么在上面的示例中没有显示状态标签?