1
Suppose I need to build a dendrogram on R:
library(tidyverse)
library(ggdendro)
ggdendrogram(hclust(dist(iris[, -5]))) +
theme(text = element_text(size = 8))
My chart is created, but I want to improve its visualization. To do this, I want to color the x-axis cells according to the values present in iris$Species
. That is, I want a scale of three colors, in which Ids 1, 2, ..., 150 will be identified from the values present in iris$Species
.
How to do this in an automated way?
Why the vote down?
– Rui Barradas