| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/ggdendro-package.R |
| 3 |
\docType{package} |
| 4 |
\name{ggdendro-package} |
| 5 |
\alias{ggdendro} |
| 6 |
\alias{ggdendro-package} |
| 7 |
\title{Create Dendrograms and Tree Diagrams using 'ggplot2'} |
| 8 |
\description{ |
| 9 |
This package enables you to create dendrograms and tree plots using |
| 10 |
\code{\link[ggplot2:ggplot]{ggplot2::ggplot()}}. |
| 11 |
} |
| 12 |
\details{ |
| 13 |
The \code{ggplot2} philosophy is to clearly separate data from the presentation. |
| 14 |
Unfortunately the plot method for dendrograms (\code{\link[=plot.dendrogram]{plot.dendrogram()}}) plots |
| 15 |
directly to a plot device without exposing the data. The \code{ggdendro} package |
| 16 |
resolves this by making available functions that extract the dendrogram plot |
| 17 |
data. This data can be used with \code{ggplot}. |
| 18 |
|
| 19 |
The function \code{\link[=dendro_data]{dendro_data()}} extracts data from different objects that |
| 20 |
contain dendrogram information. It is a generic function with methods for: |
| 21 |
\itemize{ |
| 22 |
\item \code{hclust}: \code{\link[=dendro_data.hclust]{dendro_data.hclust()}} |
| 23 |
\item dendrogram: \code{\link[=dendro_data.dendrogram]{dendro_data.dendrogram()}} |
| 24 |
\item regression trees: \code{\link[=dendro_data.tree]{dendro_data.tree()}} |
| 25 |
\item partition trees: \code{\link[=dendro_data.rpart]{dendro_data.rpart()}} |
| 26 |
\item \code{agnes} and \code{diana}: \code{\link[=dendro_data.twins]{dendro_data.twins()}} |
| 27 |
} |
| 28 |
|
| 29 |
These methods create an object of class \code{dendro}, consisting of a list of |
| 30 |
data frames. To extract the relevant data frames from the list, you can use |
| 31 |
the accessor functions: |
| 32 |
\itemize{ |
| 33 |
\item \code{\link[=segment]{segment()}}: the line segment data |
| 34 |
\item \code{\link[=label]{label()}}: the text for each end segment |
| 35 |
\item \code{\link[=leaf_label]{leaf_label()}}: the leaf labels of a tree diagram |
| 36 |
} |
| 37 |
|
| 38 |
To plot a dendrogram, either construct a plot with \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}} or use |
| 39 |
the function \code{\link[=ggdendrogram]{ggdendrogram()}}. |
| 40 |
} |
| 41 |
\seealso{ |
| 42 |
\code{\link[=dendro_data]{dendro_data()}} |
| 43 |
} |
| 44 |
\author{ |
| 45 |
Andrie de Vries - \email{[email protected]} |
| 46 |
} |
| 47 |
\keyword{package} |