Nice plots of hierarchical clustering results via ggdendrogram
Nice plots of hierarchical clustering results via ggdendrogram
This function provides two different plotting options for either a dendro object or an object that can be coerced to class dendro, using the function ggdendrogram from the package ggdendro
ggdplot(hc, lab =NULL, ptype =1, title =NULL,...)
Arguments
hc: Either a dendro object or an object that can be coerced to class dendro using the dendro_data function, i.e. objects of class dendrogram, hclust or tree
lab: A character vector of labels for the leaves of the tree. By default labels in hc are used.
ptype: A numeric indicator of the type of plot desired. If ptype==1, the plot is rotated by 90 degrees, the theme is blank, and the title is plotted. If ptype!=1, the plot is rotated by 90 degrees, and the background is a grayscale grid.
title: A character label for the title of the plot. Only used if ptype!=1.
...: other parameters passed to geom_text
Details
Given either a dendro object or an object that can be coerced to class dendro, this is a convenience function for plotting. For an object of type dendro, if ptype==1, the function executes the equivalent of