[英]Different visualization for hierarchical clustering of dendrogram
這只是部分答案。 您可以使用cluster
程序包中的clusplot
該方向進行操作。 您可能可以通過更改clusplot
的來源(鍵入getAnywhere(clusplot.default)
以獲取來源)來對此進行改進。 但是,可能需要做一些工作才能使氣泡不重疊。 無論如何,這是您從clusplot
獲得的情節。 一次查看單個圖而不是一起顯示它們可能也很有趣。
# use sample data
df <- iris[20:28, 3:4]
# calculate hierarchical clustering
hfit <- hclust(dist(df), method = 'average')
# plot dendogram
plot(hfit)
# use clusplot at all possible cutoffs and show on top of each other.
library(cluster)
clusplot(df, cutree(hfit, 1), lines = 0)
for (i in 2:nrow(df)){
clusplot(df, cutree(hfit, i), lines = 0, add = TRUE)
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.