Hello,
This is my first question to the r users’ group. Thanks in advance for any help.
I am trying to color the labels on a dendrogram I made using hclust. I want to color the branch labels by treatment. The treatment information is contained within the row names and the rows are in order in the data table so that the first 10 rows should be blue, the second 10 purple, third orange, and fourth red. I can’t seem to find an easy way to do this. The examples I found online seem to either write a complicated “if” function that I don’t understand and/or convert the plot from hclust into an object from another package (that I also don’t understand) and work on it from there.
I have attached my script and csv file if anyone wants to take a look. Please phrase any response as if you are talking to your 90 year old grandma and teaching her to use the email.
Thanks!!
Elise