Gordon O
Gordon O

Reputation: 11

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.

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?

enter image description here

Upvotes: 1

Views: 41

Answers (1)

jay.sf
jay.sf

Reputation: 73692

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')

enter image description here

Upvotes: 1

Related Questions