簡體   English   中英

使用 hclust 進行 r 編程中的簡單樹狀圖問題

[英]Simple dendogram trouble in r programming using hclust

我有一個數據集,我正在嘗試使用以下代碼對包含 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")

有人可以告訴我如何修復下面的樹狀圖嗎?

在此處輸入圖像描述

您可能想要刪除標簽。

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