1

I want to put in the labels of my dendrogram the samples name that I have in column 1 associated with the environments that I have in column 2, but I cannot find the solution.

I am using this code of hclust package:

d <- dist(mydata, method = "euclidean") # distance matrix
fit <- hclust(d, method="ward.D")
par(cex=0.3, mar=c(5, 8, 4, 1))
plot(fit)
  • Please edit your question and add a sample of your data. Use the output of `dput(head(mydata, 20))` – Dave2e Mar 31 '23 at 15:46
  • Thank you @Dave2e for the reply. I don't know why, but using the output of dput(head(mydata, 20)) my R sessions gets aborted. Do you know another way to do it? – Luca Bonfiglioli Apr 03 '23 at 08:16
  • Can you make up some data or use a built-in dataset (e.x. 'mtcars') to demonstrate? – Dave2e Apr 03 '23 at 21:33

0 Answers0