1

I have generated a dendrogram using the ggdendro package of R but I am unable to colour the labels and branches. I want to colour it according to the value of k which is k=8 in my case. How can I do it? Below is the dendrogram I have generated: enter image description here

The second picture is the one which I want. The problem with that is it doesn't have a scale for the y-axis.

enter image description here

csgillespie
  • 59,189
  • 14
  • 150
  • 185
  • Hi @Kamalika - the short answer is that you should use dendextend for this (it also has the ggdend method and functions to create what you wanted in ggplot2 if it is important). See: https://cran.r-project.org/web/packages/dendextend/vignettes/introduction.html For a longer answer, please provide a reproducible example, and I (or someone else here) can write the code to do it. Cheers, Tal – Tal Galili Sep 17 '16 at 21:37
  • Hi,thanks for the suggestion.I tried to use one of the examples provided in the link you have posted.But,the problem is that I am not able to scale the graph.The longer names are getting cut at the bottom although there is a lot of space available at the top of the graph.My file is an edgelist containing correlation values of plant metabolites. – Kamalika Ray Sep 19 '16 at 05:52
  • This sounds like something I could solve, but I will need you to create a reproducible example of this problem. Could you please do so? – Tal Galili Sep 19 '16 at 16:11

0 Answers0