I have a situation in which i am plotting a dendrogram with data points that come with class labels.
I wish to see that agglomerative clustering groups those with the same label together. Color coding the labels makes it easy to read such a dendrogram. Is there a way we can achieve this with ggdendro in R ?
I have a situation in which i am plotting a dendrogram with data points
Share
Stealing most of the setup from this post …
… and adding a grouping factor …
… you can use the
aes(colour=)argument togeom_text()to color your labels:(If you want to supply your own colors, you can use
scale_colour_manual(), doing something like this: