If you wish to change the size of the labels and make them readible you can use the dendextend package. See here for some really good info: Introduction to dendextend
Introduction to dendextend
The dendextend package offers a set of functions for extending
dendrogram objects in R, letting you visualize and compare trees of
hierarchical clusterings, you can:
- Adjust a tree’s graphical parameters - the color, size, type, etc of its branches, nodes and labels.
- Visually and statistically compare different dendrograms to one another.
The goal of this document is to introduce you to the basic functions
that dendextend provides, and show how they may be applied. We will
make extensive use of “chaining” (explained next).
Specifically:
labels_cex - set the labels’ size (using assign_values_to_leaves_nodePar)
And more specifically:
We can get a vector with the tree’s labels:
# get the labels:
dend15 %>% labels
We may also change their color and size:
par(mfrow = c(1,2))
dend15 %>% set("labels_col", "blue") %>% plot(main = "Change label's color") # change color
dend15 %>% set("labels_cex", 2) %>% plot(main = "Change label's size") # change size
Dont forget to add the library:
# install.packages("dendextend")
library(dendextend)