Reputation: 2384
I created a dendrogram in R with the command below...
I have been trying to find the command to replace the number with the name of the County which is the first column in the data set or load the plot with the name of the county instead of the number. If anyone could help that would be appreciated.
hc = hclust(dist(NYCounty))
plot(hc)
Upvotes: 0
Views: 834
Reputation: 7453
You can pass it to labels
argument in plot.hclust
. A reproducible example showing this:
# example from ?hclust
hc <- hclust(dist(USArrests), "ave")
plot(hc)
# custom labels
df <- data.frame(foo=paste("hi", 1:50))
plot(hc, labels=df$foo)
Is this what you want?
Upvotes: 1