[英]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.