This package enables you to create dendrograms and tree plots using
ggplot2 philosophy is to clearly separate data from the presentation. Unfortunately the plot method for dendrograms (
plot.dendrogram) plots directly to a plot device without exposing the data. The ggdendro package resolves this by making available functions that extract the dendrogram plot data. This data can be used with
dendro_data extracts data from different objects that contain dendrogram information. It is a generic function with methods for:
agnes and diana:
These methods create an object of class
dendro, consisting of a list of data frames. To extract the relevant data frames from the list, you can use the accessor functions:
segment: the line segment data
label: the text for each end segment
leaf_label: the leaf labels of a tree diagram
To plot a dendrogram, either construct a plot with
ggplot or use the function
Andrie de Vries - [email protected]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.