Minimal example and package documentation (https://rlbarter.github.io/superheat/):
library(superheat)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,
left.label = "none",
# add row dendrogram
col.dendrogram = TRUE,
legend=F,
)
I would like to achieve two things:
- Color branches according to cluster (which necessarily I will have to determine k number of clusters) OR add rectangles on top of "chosen" clusters.
- I would also be keen to extract and apply the same dendrogram to a different data set (with the same variables).
I believe the dendrogram is created used ggdendro (if that may assist).