简体   繁体   English

使用 hclust 进行 r 编程中的简单树状图问题

[英]Simple dendogram trouble in r programming using hclust

I have a dataset where i am trying to cluster a column with 986 observations with the below code.我有一个数据集,我正在尝试使用以下代码对包含 986 个观察值的列进行聚类。

PremiumPrice_Sclaed <- scale(data$PremiumPrice)
plot(PremiumPrice_Sclaed)

d <- dist(PremiumPrice_Sclaed) #scale for cluster
fit.average <- hclust(d, method="average")
plot(fit.average, cex = .1 ,main="Average Linkage Clustering")

can someone please tell me how to fix the below dendogram?有人可以告诉我如何修复下面的树状图吗?

在此处输入图像描述

You probably want to remove the labels.您可能想要删除标签。

hc <- hclust(dist(rbind(USArrests, USArrests, USArrests)), "ave")

par(mfrow=c(1, 2))
plot(hc, hang=-1, sub='w/ labels')
plot(hc, hang=-1, labels=FALSE, sub='w/o labels')

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM