1

I really don't know anything about R. But for a project, I've needed a hierarchical cluster dendrogram using ward's method. So my friend wrote me some codes and I just pasted them to the console. But, at the end, I cannot see the labels on the dendrogram, just the IDs. How can I see the labels?

This is what my friend sent to me.

View(camson1)
m.f<-camson1
m.f$Element<-NULL
m.stand<-scale(m.f[-1])
d <- dist(m.stand, method = "euclidean")
fit <- hclust(d, method="ward.D2")
plot(fit)
camille
  • 16,432
  • 18
  • 38
  • 60
  • 1
    It's hard to say exactly without a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). The docs for `hclust` tell you that the labels printed by default are the row names or numbers. Without having a sample of your data to work with, we don't know what those labels you want might be – camille May 19 '19 at 18:47
  • The matrix that you are using for your dataset needs to have `rownames`. – Joe Oct 01 '19 at 13:14

0 Answers0