powered by
Dendrogram plot for an hclust or dendrogram object using ggplot2.
plot_dendrogram(hc, labels = TRUE, label_size = 3, title = NULL)
returns a ggplot2::ggplot graphic
an object of class hclust or dendrogram
hclust
dendrogram
logical; whether to draw leaf labels
label text size
optional plot title
Converts a dendrogram into line segments and renders it with ggplot2.
data(iris) hc <- hclust(dist(scale(iris[,1:4])), method = "ward.D2") grf <- plot_dendrogram(hc) plot(grf)
Run the code above in your browser using DataLab