【问题标题】:how to plot hclust objects up to certain number of cuts?如何将 hclust 对象绘制到一定数量的切割?
【发布时间】:2020-05-19 03:37:42
【问题描述】:

我尝试绘制一个 hclust 对象。情节看起来不错,但我希望情节不会一直下​​降,但会在 5 次剪辑处停止。我试过 ylim 但这并没有改变情节。我的代码是

library(datasets)
    data <- iris
dist <- dist(data, method= "euclidean")
hclust <- hclust(dist, method = "complete")
plot(hclust, ylim=4:8)

【问题讨论】:

    标签: r dendrogram hclust


    【解决方案1】:

    在这里您可以找到问题的答案Plotting hclust only to the cut clusters, not every leaf

    hclust <- cut(hclust, h = 100)
    plot(hclust2$upper)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-10
      • 2020-09-28
      • 1970-01-01
      • 2018-10-28
      • 2016-04-29
      • 2019-12-14
      • 2020-10-14
      • 2017-12-18
      相关资源
      最近更新 更多