3

I would like to make the following plot (for one dimensional x), but to have it so that we would have the observations located in their correct location in the x axis (and not in their rank location):

x <- c(1,2,  7, 9)
names(x) <- x
plot(hclust(dist(x)), hang= -1)
axis(1)

enter image description here

I suspect there is no ready-made function to do this in R. Any suggestions on how to go about writing such a function?

Tal Galili
  • 24,605
  • 44
  • 129
  • 187

0 Answers0