There are several implementations for specific cluster algorithms:
To extract the data for
-line segments, labels or leaf labels use:
To extract the data for line segments, labels or leaf labels use:
ggdendrogram()
diff --git a/reference/dendro_data.rpart.html b/reference/dendro_data.rpart.html
index 611929a..f19ada4 100644
--- a/reference/dendro_data.rpart.html
+++ b/reference/dendro_data.rpart.html
@@ -1,7 +1,7 @@
Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart • ggdendroExtract data from classification tree object for plotting using ggplot. — dendro_data.rpart • ggdendroExtract data from regression tree object for plotting using ggplot. — dendro_data.tree • ggdendroExtract data from regression tree object for plotting using ggplot. — dendro_data.tree • ggdendroExtract data frame from dendrogram object for plotting using ggplot. — dendrogram_data • ggdendroExtract data frame from dendrogram object for plotting using ggplot. — dendrogram_data • ggdendro
@@ -10,7 +10,7 @@
ggdendro
-
0.1.23.9000
+
0.2.0
-
Value
diff --git a/reference/rpart_segments.html b/reference/rpart_segments.html
index f7a4efa..152acfb 100644
--- a/reference/rpart_segments.html
+++ b/reference/rpart_segments.html
@@ -1,5 +1,5 @@
-
Extract data frame from rpart object for plotting using ggplot. — rpart_segments • ggdendroExtract data frame from rpart object for plotting using ggplot. — rpart_segments • ggdendro
@@ -10,7 +10,7 @@
ggdendro
-
0.1.23.9000
+
0.2.0
@@ -68,10 +68,6 @@ Arguments
-
See also
diff --git a/reference/rpartco.html b/reference/rpartco.html
index e588d2e..39c8268 100644
--- a/reference/rpartco.html
+++ b/reference/rpartco.html
@@ -1,5 +1,5 @@
-
Compute the x-y coordinates for a tree. — rpartco • ggdendroCompute the x-y coordinates for a tree. — rpartco • ggdendro
@@ -10,7 +10,7 @@
ggdendro
-
0.1.23.9000
+
0.2.0
diff --git a/reference/segment.html b/reference/segment.html
index 5af95e8..e55d806 100644
--- a/reference/segment.html
+++ b/reference/segment.html
@@ -1,6 +1,6 @@
Returns segment, label or leaf-label data from dendro object. — segment • ggdendroReturns segment, label or leaf-label data from dendro object. — segment • ggdendroCreates completely blank theme in ggplot. — theme_dendro • ggdendroCreates completely blank theme in ggplot. — theme_dendro • ggdendroExtract labels data frame from tree object for plotting using ggplot. — tree_labels • ggdendroExtract labels data frame from tree object for plotting using ggplot. — tree_labels • ggdendro
@@ -10,7 +10,7 @@
ggdendro
- 0.1.23.9000
+ 0.2.0
diff --git a/reference/tree_segments.html b/reference/tree_segments.html
index 2844419..8560065 100644
--- a/reference/tree_segments.html
+++ b/reference/tree_segments.html
@@ -1,5 +1,5 @@
-Extract data frame from tree object for plotting using ggplot. — tree_segments • ggdendroExtract data frame from tree object for plotting using ggplot. — tree_segments • ggdendro
@@ -10,7 +10,7 @@
ggdendro
- 0.1.23.9000
+ 0.2.0
diff --git a/reference/treeco.html b/reference/treeco.html
index 02a8a3b..18bc7a7 100644
--- a/reference/treeco.html
+++ b/reference/treeco.html
@@ -1,5 +1,5 @@
-Function copied from tree:::treeco. — treeco • ggdendroFunction copied from tree:::treeco. — treeco • ggdendro
@@ -10,7 +10,7 @@
ggdendro
- 0.1.23.9000
+ 0.2.0
diff --git a/search.json b/search.json
index a68b8e5..bd65a4e 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"/articles/ggdendro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package provides general framework extract plot data dendrograms tree diagrams. providing generic function dendro_data() extracts appropriate segment label data, returning data list data frames. can access data frames using three accessor functions: segment() label() leaf_label() package also provides two convenient wrapper functions: ggdendrogram() wrapper around ggplot() create dendrogram using single line code. resulting object class ggplot, can manipulated using ggplot2 tools. theme_dendro() ggplot2 theme blank canvas, .e. axes, axis labels tick marks. ggplot2 package doesn’t get loaded automatically, remember load first:","code":"library(ggplot2) library(ggdendro)"},{"path":"/articles/ggdendro.html","id":"using-the-ggdendrogram-wrapper","dir":"Articles","previous_headings":"","what":"Using the ‘ggdendrogram()’ wrapper","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package extracts plot data dendrogram objects. Sometimes useful fine-grained control plot. times might convenient simple wrapper around ggplot() produce dendrogram small amount code. function ggdendrogram() provides wrapper produce plot single line code. provides options controlling display line segments, labels plot rotation (rotated 90 degrees ). next section shows take full control data extraction subsequent plotting.","code":"hc <- hclust(dist(USArrests), \"ave\") ggdendrogram(hc, rotate = FALSE, size = 2)"},{"path":"/articles/ggdendro.html","id":"extracting-the-dendrogram-plot-data-using-dendro_data","dir":"Articles","previous_headings":"","what":"Extracting the dendrogram plot data using ‘dendro_data()’","title":"Using 'ggdendro' to plot dendrograms","text":"hclust() dendrogram() functions R makes easy plot results hierarchical cluster analysis dendrograms R. However, hard extract data analysis customize plots, since plot() functions classes prints directly without option returning plot data. course, using ggplot2 create dendrogram means one full control appearance plot. example, data, time plotted horizontally clean background. ggplot2 means passing number options theme. ggdendro packages exports function, theme_dendro() wraps options convenient function. can also draw dendrograms triangular line segments (instead rectangular segments). example:","code":"model <- hclust(dist(USArrests), \"ave\") dhc <- as.dendrogram(model) # Rectangular lines ddata <- dendro_data(dhc, type = \"rectangle\") p <- ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) p p + coord_flip() + theme_dendro() #> Coordinate system already present. Adding new coordinate system, which will #> replace the existing one. ddata <- dendro_data(dhc, type = \"triangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro()"},{"path":"/articles/ggdendro.html","id":"regression-tree-diagrams","dir":"Articles","previous_headings":"","what":"Regression tree diagrams","title":"Using 'ggdendro' to plot dendrograms","text":"tree() function package tree creates tree diagrams. extract plot data diagrams using ggdendro, use idiom plotting dendrograms:","code":"if(require(tree)){ data(cpus, package = \"MASS\") model <- tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax, data = cpus) tree_data <- dendro_data(model) ggplot(segment(tree_data)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend, size = n), colour = \"blue\", alpha = 0.5) + scale_size(\"n\") + geom_text(data = label(tree_data), aes(x = x, y = y, label = label), vjust = -0.5, size = 3) + geom_text(data = leaf_label(tree_data), aes(x = x, y = y, label = label), vjust = 0.5, size = 2) + theme_dendro() } #> Loading required package: tree #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"/articles/ggdendro.html","id":"classification-tree-diagrams","dir":"Articles","previous_headings":"","what":"Classification tree diagrams","title":"Using 'ggdendro' to plot dendrograms","text":"rpart() function package rpart creates classification diagrams. extract plot data diagrams using ggdendro follows basic pattern dendrograms:","code":"if(require(rpart)){ model <- rpart(Kyphosis ~ Age + Number + Start, method = \"class\", data = kyphosis) ddata <- dendro_data(model) ggplot() + geom_segment(data = ddata$segments, aes(x = x, y = y, xend = xend, yend = yend)) + geom_text(data = ddata$labels, aes(x = x, y = y, label = label), size = 3, vjust = 0) + geom_text(data = ddata$leaf_labels, aes(x = x, y = y, label = label), size = 3, vjust = 1) + theme_dendro() } #> Loading required package: rpart"},{"path":"/articles/ggdendro.html","id":"twins-diagrams-agnes-and-diana","dir":"Articles","previous_headings":"","what":"Twins diagrams: ‘agnes’ and ‘diana’","title":"Using 'ggdendro' to plot dendrograms","text":"cluster package allows draw agnes diana diagrams.","code":"if(require(cluster)){ model <- agnes(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) model <- diana(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) } #> Loading required package: cluster"},{"path":"/articles/ggdendro.html","id":"summary","dir":"Articles","previous_headings":"","what":"Summary","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package makes easy extract line segment label data hclust, dendrogram tree objects.","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Andrie de Vries. Author, maintainer. Brian D. Ripley. Author. author package tree","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"de Vries , Ripley BD (2023). ggdendro: Create Dendrograms Tree Diagrams Using 'ggplot2'. R package version 0.1.23.9000, https://andrie.github.io/ggdendro/.","code":"@Manual{, title = {ggdendro: Create Dendrograms and Tree Diagrams Using 'ggplot2'}, author = {Andrie {de Vries} and Brian D. Ripley}, year = {2023}, note = {R package version 0.1.23.9000}, url = {https://andrie.github.io/ggdendro/}, }"},{"path":"/index.html","id":"ggdendro-","dir":"","previous_headings":"","what":"Create Dendrograms and Tree Diagrams Using ggplot2","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"Provides functions creating dendrograms tree plots using ggplot2. ggdendro package offers generic function extract data text various clustering models: dendro_data() extracts cluster information model object, e.g. cluster allocation, line segment data label data. dendro_data object methods following classes: tree hclust dendrogram rpart methods create object class dendro, essentially list data frames. extract relevant data frames list, use three accessor functions: segment() line segment data label() text end segment leaf_label() leaf labels tree diagram results functions can passed ggplot() plotting.","code":""},{"path":"/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"","code":"library(ggplot2) library(ggdendro) hc <- hclust(dist(USArrests), \"ave\") hcdata <- dendro_data(hc, type = \"rectangle\") ggplot() + geom_segment(data = segment(hcdata), aes(x = x, y = y, xend = xend, yend = yend) ) + geom_text(data = label(hcdata), aes(x = x, y = y, label = label, hjust = 0), size = 3 ) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) ### demonstrate plotting directly from object class hclust ggdendrogram(hc) ggdendrogram(hc, rotate = TRUE) ### demonstrate converting hclust to dendro using dendro_data first hcdata <- dendro_data(hc) ggdendrogram(hcdata, rotate = TRUE) + labs(title = \"Dendrogram in ggplot2\")"},{"path":"/index.html","id":"use-dendextend-instead","dir":"","previous_headings":"","what":"Use dendextend instead","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"functionality ggdendro included excellent dendextend package. cases, need additional functionality, please use dendextend package instead. ggdendro package get minimal maintenance future. Refer https://cran.r-project.org/web/packages/dendextend/index.html","code":""},{"path":"/reference/as.dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerces object to class dendro. — as.dendro","title":"Coerces object to class dendro. — as.dendro","text":"Method coercing object class dendro.","code":""},{"path":"/reference/as.dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerces object to class dendro. — as.dendro","text":"","code":"as.dendro(segments, labels, leaf_labels = NULL, class)"},{"path":"/reference/as.dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerces object to class dendro. — as.dendro","text":"segments data.frame segment data labels data.frame labels data leaf_labels data.frame leaf label data class class original model object, e.g. \"hclust\". used ggdendrogram() determine angle justification labels","code":""},{"path":[]},{"path":"/reference/dendro_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract cluster data from a model into a list of data frames. — dendro_data","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"function provides generic mechanism extract relevant plotting data, typically line segments labels, variety cluster models. Extract line segment label data stats::dendrogram() stats::hclust() object. resulting object list data frames containing line segment data label data.","code":""},{"path":"/reference/dendro_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"","code":"dendro_data(model, ...) # S3 method for default dendro_data(model, ...) # S3 method for dendrogram dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...) # S3 method for hclust dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...) # S3 method for twins dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...)"},{"path":"/reference/dendro_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"model object class \"dendrogram\", e.g. output .dendrogram() ... ignored type type plot, indicating shape dendrogram. \"rectangle\" draw rectangular lines, \"triangle\" draw triangular lines.","code":""},{"path":"/reference/dendro_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"list data frames contain data appropriate cluster model list components: segments Line segment data labels Label data","code":""},{"path":"/reference/dendro_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"stats::dendrogram() tree::tree() models, extracts line segment data labels.","code":""},{"path":[]},{"path":"/reference/dendro_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"","code":"require(ggplot2) #> Loading required package: ggplot2 ### Demonstrate dendro_data.dendrogram model <- hclust(dist(USArrests), \"ave\") dendro <- as.dendrogram(model) # Rectangular lines ddata <- dendro_data(dendro, type = \"rectangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro() # Triangular lines ddata <- dendro_data(dendro, type = \"triangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + theme_dendro() # Demonstrate dendro_data.hclust require(ggplot2) hc <- hclust(dist(USArrests), \"ave\") # Rectangular lines hcdata <- dendro_data(hc, type = \"rectangle\") ggplot(segment(hcdata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro() # Triangular lines hcdata <- dendro_data(hc, type = \"triangle\") ggplot(segment(hcdata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + theme_dendro() ### Demonstrate the twins of agnes and diana, from package cluster if (require(cluster)) { model <- agnes(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) } #> Loading required package: cluster if (require(cluster)) { model <- diana(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) }"},{"path":"/reference/dendro_data.rpart.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"Extracts data plot line segments labels rpart::rpart() classification tree object. data can manipulated plotted, e.g. using ggplot2::ggplot().","code":""},{"path":"/reference/dendro_data.rpart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"","code":"# S3 method for rpart dendro_data( model, uniform = FALSE, branch = 1, compress = FALSE, nspace, minbranch = 0.3, ... )"},{"path":"/reference/dendro_data.rpart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"model object class \"tree\", e.g. output tree() uniform TRUE, uniform vertical spacing nodes used; may less cluttered fitting large plot onto page. default use non-uniform spacing proportional error fit. branch controls shape branches parent child node. number 0 1 allowed. value 1 gives square shouldered branches, value 0 give V shaped branches, values intermediate. compress FALSE, leaf nodes horizontal plot coordinates 1:nleaves. TRUE, routine attempts compact arrangement tree. compaction algorithm assumes uniform=TRUE; surprisingly, result usually improvement even case. nspace amount extra space node children leaf, compared minimal space leaves. Applies compressed trees . default value branch. minbranch set minimum length branch minbranch times average branch length. parameter ignored uniform=TRUE. Sometimes split give little improvement, even (classification case) improvement . tree branch lengths strictly proportional improvement leaves room squeeze node labels. ... ignored","code":""},{"path":"/reference/dendro_data.rpart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"list three data frames: segments data frame containing line segment data labels data frame containing label text data leaf_labels data frame containing leaf label text data","code":""},{"path":"/reference/dendro_data.rpart.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"code essence copy rpart::plot.rpart(), retaining plot data without plotting plot device.","code":""},{"path":[]},{"path":"/reference/dendro_data.rpart.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"","code":"### Demonstrate rpart if (require(rpart)) { require(ggplot2) fit <- rpart(Kyphosis ~ Age + Number + Start, method = \"class\", data = kyphosis) fitr <- dendro_data(fit) ggplot() + geom_segment(data = fitr$segments, aes(x = x, y = y, xend = xend, yend = yend) ) + geom_text(data = fitr$labels, aes(x = x, y = y, label = label)) + geom_text(data = fitr$leaf_labels, aes(x = x, y = y, label = label)) + theme_dendro() } #> Loading required package: rpart"},{"path":"/reference/dendro_data.tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"Extracts data plot line segments labels tree::tree() object. data can manipulated plotted, e.g. using ggplot2::ggplot().","code":""},{"path":"/reference/dendro_data.tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"","code":"# S3 method for tree dendro_data(model, type = c(\"proportional\", \"uniform\"), ...)"},{"path":"/reference/dendro_data.tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"model object class \"tree\", e.g. output tree() type Either proportional uniform. partially matches \"uniform\", branches uniform length. Otherwise proportional decrease impurity. ... ignored","code":""},{"path":"/reference/dendro_data.tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"list three data frames: segments data frame containing line segment data labels data frame containing label text data leaf_labels data frame containing leaf label text data","code":""},{"path":[]},{"path":"/reference/dendro_data.tree.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"Andrie de Vries, using code modified original Brian Ripley","code":""},{"path":"/reference/dendro_data.tree.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"","code":"### Demonstrate tree if (require(tree)) { require(ggplot2) require(MASS) data(cpus, package = \"MASS\") cpus.ltr <- tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax, data = cpus) tree_data <- dendro_data(cpus.ltr) ggplot(segment(tree_data)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend, linewidth = n), colour = \"lightblue\" ) + scale_size(\"n\") + geom_text( data = label(tree_data), aes(x = x, y = y, label = label), vjust = -0.5, size = 4 ) + geom_text( data = leaf_label(tree_data), aes(x = x, y = y, label = label), vjust = 0.5, size = 3 ) + theme_dendro() } #> Loading required package: tree #> Loading required package: MASS"},{"path":"/reference/dendrogram_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"Extract data frame dendrogram object plotting using ggplot","code":""},{"path":"/reference/dendrogram_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"","code":"dendrogram_data(x, type = c(\"rectangle\", \"triangle\"), ...)"},{"path":"/reference/dendrogram_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"x object class \"dendrogram\", e.g. output .dendrogram() type type plot, indicating shape dendrogram: \"rectangle\" draw rectangular lines, \"triangle\" draw triangular lines. ... ignored","code":""},{"path":[]},{"path":"/reference/get_data_tree_leaf_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"Extract labels data frame tree object plotting using ggplot","code":""},{"path":"/reference/get_data_tree_leaf_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"","code":"get_data_tree_leaf_labels(model, uniform, ...)"},{"path":"/reference/get_data_tree_leaf_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":[]},{"path":"/reference/get_data_tree_leaf_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/ggdendro-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"package enables create dendrograms tree plots using ggplot2::ggplot().","code":""},{"path":"/reference/ggdendro-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"ggplot2 philosophy clearly separate data presentation. Unfortunately plot method dendrograms (plot.dendrogram()) plots directly plot device without exposing data. ggdendro package resolves making available functions extract dendrogram plot data. data can used ggplot. function dendro_data() extracts data different objects contain dendrogram information. generic function methods : hclust: dendro_data.hclust() dendrogram: dendro_data.dendrogram() regression trees: dendro_data.tree() partition trees: dendro_data.rpart() agnes diana: dendro_data.twins() methods create object class dendro, consisting list data frames. extract relevant data frames list, can use accessor functions: segment(): line segment data label(): text end segment leaf_label(): leaf labels tree diagram plot dendrogram, either construct plot ggplot2::ggplot() use function ggdendrogram().","code":""},{"path":[]},{"path":"/reference/ggdendro-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"Andrie de Vries - apdevries@gmail.com","code":""},{"path":"/reference/ggdendrogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates dendrogram plot using ggplot. — ggdendrogram","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"convenience function","code":""},{"path":"/reference/ggdendrogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"","code":"ggdendrogram( data, segments = TRUE, labels = TRUE, leaf_labels = TRUE, rotate = FALSE, theme_dendro = TRUE, ... )"},{"path":"/reference/ggdendrogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"data Either dendro object object can coerced class dendro using dendro_data() function, .e. objects class dendrogram, hclust tree segments TRUE, show line segments labels TRUE, shows segment labels leaf_labels TRUE, shows leaf labels rotate TRUE, rotates plot 90 degrees theme_dendro TRUE, applies blank theme plot (see theme_dendro()) ... parameters passed ggplot2::geom_text()","code":""},{"path":"/reference/ggdendrogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"ggplot2::ggplot() object","code":""},{"path":[]},{"path":"/reference/ggdendrogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"","code":"### Demonstrate ggdendrogram library(ggplot2) hc <- hclust(dist(USArrests), \"ave\") # Demonstrate plotting directly from object class hclust p <- ggdendrogram(hc, rotate = FALSE) print(p) ggdendrogram(hc, rotate = TRUE) # demonstrate converting hclust to dendro using dendro_data first hcdata <- dendro_data(hc) ggdendrogram(hcdata, rotate = TRUE, size = 2) + labs(title = \"Dendrogram in ggplot2\")"},{"path":"/reference/is.dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests whether an object is of class dendro. — is.dendro","title":"Tests whether an object is of class dendro. — is.dendro","text":"dendro? Tests whether object class dendro.","code":""},{"path":"/reference/is.dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests whether an object is of class dendro. — is.dendro","text":"","code":"is.dendro(x)"},{"path":"/reference/is.dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests whether an object is of class dendro. — is.dendro","text":"x Object check","code":""},{"path":[]},{"path":"/reference/labels.rpart.html","id":null,"dir":"Reference","previous_headings":"","what":"Make the nice labels used by print and summary. — labels.rpart","title":"Make the nice labels used by print and summary. — labels.rpart","text":"Make nice labels used print summary.","code":""},{"path":"/reference/labels.rpart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make the nice labels used by print and summary. — labels.rpart","text":"","code":"# S3 method for rpart labels(object, digits = 4, minlength = 1L, pretty, collapse = TRUE, ...)"},{"path":"/reference/labels.rpart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make the nice labels used by print and summary. — labels.rpart","text":"digits obvious minlength 0 = abbrev factors; 1 = use single letters; 2+= arg \"abbreviate\" function collapse oddly named argument: FALSE = return matrix two columns, containing labels left right descendants node; TRUE = return vector 1 column, label parent ... = args abbreviate() pretty: historical compatibility: 0 -> minlength = 0; NULL -> minlength = 1; TRUE -> minlength = 4","code":""},{"path":"/reference/rpart_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"code modified original plot.rpart package rpart.","code":""},{"path":"/reference/rpart_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"","code":"rpart_labels(x)"},{"path":"/reference/rpart_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"model object class \"rpart\", e.g. output rpart() ... ignored","code":""},{"path":"/reference/rpart_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"list two elements: $labels $leaf_labels","code":""},{"path":[]},{"path":"/reference/rpart_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"Original author Brian Ripley","code":""},{"path":"/reference/rpart_segments.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"Extract data frame rpart object plotting using ggplot.","code":""},{"path":"/reference/rpart_segments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"","code":"rpart_segments(x, ...)"},{"path":"/reference/rpart_segments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"... ignored model object class \"tree\", e.g. output tree()","code":""},{"path":[]},{"path":"/reference/rpartco.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute the x-y coordinates for a tree. — rpartco","title":"Compute the x-y coordinates for a tree. — rpartco","text":"Compute x-y coordinates tree.","code":""},{"path":"/reference/rpartco.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute the x-y coordinates for a tree. — rpartco","text":"","code":"rpartco(tree, parms)"},{"path":"/reference/rpartco.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute the x-y coordinates for a tree. — rpartco","text":"tree Tree model parms Graphics parameters","code":""},{"path":"/reference/segment.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns segment, label or leaf-label data from dendro object. — segment","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"segment extracts line segments, label extracts labels, leaf_label extracts leaf labels dendro object.","code":""},{"path":"/reference/segment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"","code":"segment(x) label(x) leaf_label(x)"},{"path":"/reference/segment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"x dendro object","code":""},{"path":[]},{"path":"/reference/theme_dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates completely blank theme in ggplot. — theme_dendro","title":"Creates completely blank theme in ggplot. — theme_dendro","text":"Sets ggplot options blank, returning blank theme elements panel grid, panel background, axis title, axis text, axis line axis ticks.","code":""},{"path":"/reference/theme_dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates completely blank theme in ggplot. — theme_dendro","text":"","code":"theme_dendro()"},{"path":"/reference/tree_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"Extract labels data frame tree object plotting using ggplot.","code":""},{"path":"/reference/tree_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"","code":"tree_labels(model, uniform, ...)"},{"path":"/reference/tree_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":"/reference/tree_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"list two elements: $labels $leaf_labels","code":""},{"path":[]},{"path":"/reference/tree_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/tree_segments.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from tree object for plotting using ggplot. — tree_segments","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"Extract data frame tree object plotting using ggplot.","code":""},{"path":"/reference/tree_segments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"","code":"tree_segments(model, uniform, ...)"},{"path":"/reference/tree_segments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":[]},{"path":"/reference/tree_segments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/treeco.html","id":null,"dir":"Reference","previous_headings":"","what":"Function copied from tree:::treeco. — treeco","title":"Function copied from tree:::treeco. — treeco","text":"Function copied tree:::treeco.","code":""},{"path":"/reference/treeco.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function copied from tree:::treeco. — treeco","text":"","code":"treeco(tree, uniform)"},{"path":"/reference/treeco.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function copied from tree:::treeco. — treeco","text":"tree tree object uniform ???","code":""},{"path":"/news/index.html","id":"ggdendro-01239000","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.23.9000","title":"ggdendro 0.1.23.9000","text":"Bug fix: Fix longstanding bug plotting large amounts data used caused node overflow (#27) : Fix deprecated ggplot() aes usage","code":""},{"path":"/news/index.html","id":"ggdendro-0123","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.23","title":"ggdendro 0.1.23","text":"CRAN release: 2022-02-16 functional changes. Minor changes comply CRAN policy.","code":""},{"path":"/news/index.html","id":"ggdendro-0122","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.22","title":"ggdendro 0.1.22","text":"CRAN release: 2020-09-13 functional changes Update tests conform testthat_3.0.0","code":""},{"path":"/news/index.html","id":"ggdendro-0121","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.21","title":"ggdendro 0.1.21","text":"CRAN release: 2020-08-11 Bug fixes: Fix alignment leaf labels rotate=FALSE #28 changes Re-styled files follow tidyverse style guide Added pkgdown site http://andrie.github.io/ggdendro/ Added spellcheck fixed spelling mistakes","code":""},{"path":"/news/index.html","id":"ggdendro-01-20","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-20","title":"ggdendro 0.1-20","text":"CRAN release: 2016-04-27 Enhancements: Don’t open plot device calculation segment data #25","code":""},{"path":"/news/index.html","id":"ggdendro-01-19","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-19","title":"ggdendro 0.1-19","text":"Bug fix release. Functional changes: Removed margin argument dendro_data.rpart, since effect plot. Bug fixes: Fixed issue #20: Plot data dependent device, causing errors spurious new devices Fixed issue #24: Labels don’t print ggdendrogram() package scales_0.4 Fixed issue #22: Margin working dendro_data.rpart","code":""},{"path":"/news/index.html","id":"ggdendro-01-16","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-16","title":"ggdendro 0.1-16","text":"New functionality: Added support objects class twins packages cluster, specifically agnes diana objects (pull request #14 @unikum) Fixes: - Many small changes improvements documentation","code":""},{"path":"/news/index.html","id":"ggdendro-01-15","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-15","title":"ggdendro 0.1-15","text":"CRAN release: 2014-09-29 New functionality: - None Changes: bug fixes Unit tests now run R CMD check Modified vignette use knitr instead SWeave","code":""},{"path":"/news/index.html","id":"ggdendro-01-14","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-14","title":"ggdendro 0.1-14","text":"CRAN release: 2013-09-03 New functionality * Added support rpart Changes: * Modified code suggest tree, rather import * Changed plot behaviour ggdendrogram() prettier axis labels * Removed references hidden functions package stats","code":""},{"path":"/news/index.html","id":"ggdendro-01-12","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-12","title":"ggdendro 0.1-12","text":"CRAN release: 2013-01-28 New functionality * None Changes: * ggdendro now imports MASS, tree ggplot2 (rather suggests) * Added Brian D. Ripley author (original author package tree)","code":""},{"path":"/news/index.html","id":"ggdendro-01-09","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-09","title":"ggdendro 0.1-09","text":"New functionality * None Changes: * Removed support rpart * Changed Licence GPL (>=2) GPL-2|GPL-3 conform rtree license conditions","code":""},{"path":"/news/index.html","id":"ggdendro-01-07","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-07","title":"ggdendro 0.1-07","text":"New functionality: None Changes: Modified code conform ggplot2 v0.9.2","code":""},{"path":"/news/index.html","id":"ggdendro-01-04","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-04","title":"ggdendro 0.1-04","text":"New functionality: None Modified examples conform ggplot2 v0.9","code":""},{"path":"/news/index.html","id":"ggdendro-01-02","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-02","title":"ggdendro 0.1-02","text":"New functionality: Added support classification trees using package:rpart Fixed bugs: * Classification trees using tree produced error due attempted rounding factor variables Changes API * Fixed inconsistencies names data.frame segments. names now always x, y, xend yend","code":""},{"path":"/news/index.html","id":"ggdendro-00-7","dir":"Changelog","previous_headings":"","what":"ggdendro 0.0-7","title":"ggdendro 0.0-7","text":"New functionality * Included ggdendrogram function conveniently creates ggplot dendrogram single line code. * Created theme_dendro, almost blank theme","code":""},{"path":"/news/index.html","id":"ggdendro-00","dir":"Changelog","previous_headings":"","what":"ggdendro 0.0","title":"ggdendro 0.0","text":"Experimental release package. Supports extraction plot data following classes: dendrogram tree hclust","code":""}]
+[{"path":"/articles/ggdendro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package provides general framework extract plot data dendrograms tree diagrams. providing generic function dendro_data() extracts appropriate segment label data, returning data list data frames. can access data frames using three accessor functions: segment() label() leaf_label() package also provides two convenient wrapper functions: ggdendrogram() wrapper around ggplot() create dendrogram using single line code. resulting object class ggplot, can manipulated using ggplot2 tools. theme_dendro() ggplot2 theme blank canvas, .e. axes, axis labels tick marks. ggplot2 package doesn’t get loaded automatically, remember load first:","code":"library(ggplot2) library(ggdendro)"},{"path":"/articles/ggdendro.html","id":"using-the-ggdendrogram-wrapper","dir":"Articles","previous_headings":"","what":"Using the ‘ggdendrogram()’ wrapper","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package extracts plot data dendrogram objects. Sometimes useful fine-grained control plot. times might convenient simple wrapper around ggplot() produce dendrogram small amount code. function ggdendrogram() provides wrapper produce plot single line code. provides options controlling display line segments, labels plot rotation (rotated 90 degrees ). next section shows take full control data extraction subsequent plotting.","code":"hc <- hclust(dist(USArrests), \"ave\") ggdendrogram(hc, rotate = FALSE, size = 2)"},{"path":"/articles/ggdendro.html","id":"extracting-the-dendrogram-plot-data-using-dendro_data","dir":"Articles","previous_headings":"","what":"Extracting the dendrogram plot data using ‘dendro_data()’","title":"Using 'ggdendro' to plot dendrograms","text":"hclust() dendrogram() functions R makes easy plot results hierarchical cluster analysis dendrograms R. However, hard extract data analysis customize plots, since plot() functions classes prints directly without option returning plot data. course, using ggplot2 create dendrogram means one full control appearance plot. example, data, time plotted horizontally clean background. ggplot2 means passing number options theme. ggdendro packages exports function, theme_dendro() wraps options convenient function. can also draw dendrograms triangular line segments (instead rectangular segments). example:","code":"model <- hclust(dist(USArrests), \"ave\") dhc <- as.dendrogram(model) # Rectangular lines ddata <- dendro_data(dhc, type = \"rectangle\") p <- ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) p p + coord_flip() + theme_dendro() #> Coordinate system already present. Adding new coordinate system, which will #> replace the existing one. ddata <- dendro_data(dhc, type = \"triangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro()"},{"path":"/articles/ggdendro.html","id":"regression-tree-diagrams","dir":"Articles","previous_headings":"","what":"Regression tree diagrams","title":"Using 'ggdendro' to plot dendrograms","text":"tree() function package tree creates tree diagrams. extract plot data diagrams using ggdendro, use idiom plotting dendrograms:","code":"if(require(tree)){ data(cpus, package = \"MASS\") model <- tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax, data = cpus) tree_data <- dendro_data(model) ggplot(segment(tree_data)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend, size = n), colour = \"blue\", alpha = 0.5) + scale_size(\"n\") + geom_text(data = label(tree_data), aes(x = x, y = y, label = label), vjust = -0.5, size = 3) + geom_text(data = leaf_label(tree_data), aes(x = x, y = y, label = label), vjust = 0.5, size = 2) + theme_dendro() } #> Loading required package: tree #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"/articles/ggdendro.html","id":"classification-tree-diagrams","dir":"Articles","previous_headings":"","what":"Classification tree diagrams","title":"Using 'ggdendro' to plot dendrograms","text":"rpart() function package rpart creates classification diagrams. extract plot data diagrams using ggdendro follows basic pattern dendrograms:","code":"if(require(rpart)){ model <- rpart(Kyphosis ~ Age + Number + Start, method = \"class\", data = kyphosis) ddata <- dendro_data(model) ggplot() + geom_segment(data = ddata$segments, aes(x = x, y = y, xend = xend, yend = yend)) + geom_text(data = ddata$labels, aes(x = x, y = y, label = label), size = 3, vjust = 0) + geom_text(data = ddata$leaf_labels, aes(x = x, y = y, label = label), size = 3, vjust = 1) + theme_dendro() } #> Loading required package: rpart"},{"path":"/articles/ggdendro.html","id":"twins-diagrams-agnes-and-diana","dir":"Articles","previous_headings":"","what":"Twins diagrams: ‘agnes’ and ‘diana’","title":"Using 'ggdendro' to plot dendrograms","text":"cluster package allows draw agnes diana diagrams.","code":"if(require(cluster)){ model <- agnes(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) model <- diana(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) } #> Loading required package: cluster"},{"path":"/articles/ggdendro.html","id":"summary","dir":"Articles","previous_headings":"","what":"Summary","title":"Using 'ggdendro' to plot dendrograms","text":"ggdendro package makes easy extract line segment label data hclust, dendrogram tree objects.","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Andrie de Vries. Author, maintainer. Brian D. Ripley. Author. author package tree","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"de Vries , Ripley BD (2024). ggdendro: Create Dendrograms Tree Diagrams Using 'ggplot2'. R package version 0.2.0, https://andrie.github.io/ggdendro/.","code":"@Manual{, title = {ggdendro: Create Dendrograms and Tree Diagrams Using 'ggplot2'}, author = {Andrie {de Vries} and Brian D. Ripley}, year = {2024}, note = {R package version 0.2.0}, url = {https://andrie.github.io/ggdendro/}, }"},{"path":"/index.html","id":"ggdendro-","dir":"","previous_headings":"","what":"Create Dendrograms and Tree Diagrams Using ggplot2","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"Provides functions creating dendrograms tree plots using ggplot2. ggdendro package offers generic function extract data text various clustering models: dendro_data() extracts cluster information model object, e.g. cluster allocation, line segment data label data. dendro_data object methods following classes: tree hclust dendrogram rpart methods create object class dendro, essentially list data frames. extract relevant data frames list, use three accessor functions: segment() line segment data label() text end segment leaf_label() leaf labels tree diagram results functions can passed ggplot() plotting.","code":""},{"path":"/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"","code":"library(ggplot2) library(ggdendro) hc <- hclust(dist(USArrests), \"ave\") hcdata <- dendro_data(hc, type = \"rectangle\") ggplot() + geom_segment(data = segment(hcdata), aes(x = x, y = y, xend = xend, yend = yend) ) + geom_text(data = label(hcdata), aes(x = x, y = y, label = label, hjust = 0), size = 3 ) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) ### demonstrate plotting directly from object class hclust ggdendrogram(hc) ggdendrogram(hc, rotate = TRUE) ### demonstrate converting hclust to dendro using dendro_data first hcdata <- dendro_data(hc) ggdendrogram(hcdata, rotate = TRUE) + labs(title = \"Dendrogram in ggplot2\")"},{"path":"/index.html","id":"use-dendextend-instead","dir":"","previous_headings":"","what":"Use dendextend instead","title":"Create Dendrograms and Tree Diagrams Using ggplot2","text":"functionality ggdendro included excellent dendextend package. cases, need additional functionality, please use dendextend package instead. ggdendro package get minimal maintenance future. Refer https://cran.r-project.org/web/packages/dendextend/index.html","code":""},{"path":"/reference/as.dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerces object to class dendro. — as.dendro","title":"Coerces object to class dendro. — as.dendro","text":"Method coercing object class dendro.","code":""},{"path":"/reference/as.dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerces object to class dendro. — as.dendro","text":"","code":"as.dendro(segments, labels, leaf_labels = NULL, class)"},{"path":"/reference/as.dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerces object to class dendro. — as.dendro","text":"segments data.frame segment data labels data.frame labels data leaf_labels data.frame leaf label data class class original model object, e.g. \"hclust\". used ggdendrogram() determine angle justification labels","code":""},{"path":[]},{"path":"/reference/dendro_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract cluster data from a model into a list of data frames. — dendro_data","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"function provides generic mechanism extract relevant plotting data, typically line segments labels, variety cluster models. Extract line segment label data stats::dendrogram() stats::hclust() object. resulting object list data frames containing line segment data label data.","code":""},{"path":"/reference/dendro_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"","code":"dendro_data(model, ...) # S3 method for default dendro_data(model, ...) # S3 method for dendrogram dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...) # S3 method for hclust dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...) # S3 method for twins dendro_data(model, type = c(\"rectangle\", \"triangle\"), ...)"},{"path":"/reference/dendro_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"model object class \"dendrogram\", e.g. output .dendrogram() ... ignored type type plot, indicating shape dendrogram. \"rectangle\" draw rectangular lines, \"triangle\" draw triangular lines.","code":""},{"path":"/reference/dendro_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"list data frames contain data appropriate cluster model list components: segments Line segment data labels Label data","code":""},{"path":"/reference/dendro_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"stats::dendrogram() tree::tree() models, extracts line segment data labels.","code":""},{"path":[]},{"path":"/reference/dendro_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract cluster data from a model into a list of data frames. — dendro_data","text":"","code":"require(ggplot2) #> Loading required package: ggplot2 ### Demonstrate dendro_data.dendrogram model <- hclust(dist(USArrests), \"ave\") dendro <- as.dendrogram(model) # Rectangular lines ddata <- dendro_data(dendro, type = \"rectangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro() # Triangular lines ddata <- dendro_data(dendro, type = \"triangle\") ggplot(segment(ddata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + theme_dendro() # Demonstrate dendro_data.hclust require(ggplot2) hc <- hclust(dist(USArrests), \"ave\") # Rectangular lines hcdata <- dendro_data(hc, type = \"rectangle\") ggplot(segment(hcdata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + coord_flip() + scale_y_reverse(expand = c(0.2, 0)) + theme_dendro() # Triangular lines hcdata <- dendro_data(hc, type = \"triangle\") ggplot(segment(hcdata)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend)) + theme_dendro() ### Demonstrate the twins of agnes and diana, from package cluster if (require(cluster)) { model <- agnes(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) } #> Loading required package: cluster if (require(cluster)) { model <- diana(votes.repub, metric = \"manhattan\", stand = TRUE) dg <- as.dendrogram(model) ggdendrogram(dg) }"},{"path":"/reference/dendro_data.rpart.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"Extracts data plot line segments labels rpart::rpart() classification tree object. data can manipulated plotted, e.g. using ggplot2::ggplot().","code":""},{"path":"/reference/dendro_data.rpart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"","code":"# S3 method for rpart dendro_data( model, uniform = FALSE, branch = 1, compress = FALSE, nspace, minbranch = 0.3, ... )"},{"path":"/reference/dendro_data.rpart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"model object class \"tree\", e.g. output tree() uniform TRUE, uniform vertical spacing nodes used; may less cluttered fitting large plot onto page. default use non-uniform spacing proportional error fit. branch controls shape branches parent child node. number 0 1 allowed. value 1 gives square shouldered branches, value 0 give V shaped branches, values intermediate. compress FALSE, leaf nodes horizontal plot coordinates 1:nleaves. TRUE, routine attempts compact arrangement tree. compaction algorithm assumes uniform=TRUE; surprisingly, result usually improvement even case. nspace amount extra space node children leaf, compared minimal space leaves. Applies compressed trees . default value branch. minbranch set minimum length branch minbranch times average branch length. parameter ignored uniform=TRUE. Sometimes split give little improvement, even (classification case) improvement . tree branch lengths strictly proportional improvement leaves room squeeze node labels. ... ignored","code":""},{"path":"/reference/dendro_data.rpart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"list three data frames: segments data frame containing line segment data labels data frame containing label text data leaf_labels data frame containing leaf label text data","code":""},{"path":"/reference/dendro_data.rpart.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"code essence copy rpart::plot.rpart(), retaining plot data without plotting plot device.","code":""},{"path":[]},{"path":"/reference/dendro_data.rpart.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract data from classification tree object for plotting using ggplot. — dendro_data.rpart","text":"","code":"### Demonstrate rpart if (require(rpart)) { require(ggplot2) fit <- rpart(Kyphosis ~ Age + Number + Start, method = \"class\", data = kyphosis) fitr <- dendro_data(fit) ggplot() + geom_segment(data = fitr$segments, aes(x = x, y = y, xend = xend, yend = yend) ) + geom_text(data = fitr$labels, aes(x = x, y = y, label = label)) + geom_text(data = fitr$leaf_labels, aes(x = x, y = y, label = label)) + theme_dendro() } #> Loading required package: rpart"},{"path":"/reference/dendro_data.tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"Extracts data plot line segments labels tree::tree() object. data can manipulated plotted, e.g. using ggplot2::ggplot().","code":""},{"path":"/reference/dendro_data.tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"","code":"# S3 method for tree dendro_data(model, type = c(\"proportional\", \"uniform\"), ...)"},{"path":"/reference/dendro_data.tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"model object class \"tree\", e.g. output tree() type Either proportional uniform. partially matches \"uniform\", branches uniform length. Otherwise proportional decrease impurity. ... ignored","code":""},{"path":"/reference/dendro_data.tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"list three data frames: segments data frame containing line segment data labels data frame containing label text data leaf_labels data frame containing leaf label text data","code":""},{"path":[]},{"path":"/reference/dendro_data.tree.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"Andrie de Vries, using code modified original Brian Ripley","code":""},{"path":"/reference/dendro_data.tree.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract data from regression tree object for plotting using ggplot. — dendro_data.tree","text":"","code":"### Demonstrate tree if (require(tree)) { require(ggplot2) require(MASS) data(cpus, package = \"MASS\") cpus.ltr <- tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax, data = cpus) tree_data <- dendro_data(cpus.ltr) ggplot(segment(tree_data)) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend, linewidth = n), colour = \"lightblue\" ) + scale_size(\"n\") + geom_text( data = label(tree_data), aes(x = x, y = y, label = label), vjust = -0.5, size = 4 ) + geom_text( data = leaf_label(tree_data), aes(x = x, y = y, label = label), vjust = 0.5, size = 3 ) + theme_dendro() } #> Loading required package: tree #> Loading required package: MASS"},{"path":"/reference/dendrogram_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"Extract data frame dendrogram object plotting using ggplot","code":""},{"path":"/reference/dendrogram_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"","code":"dendrogram_data(x, type = c(\"rectangle\", \"triangle\"), ...)"},{"path":"/reference/dendrogram_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from dendrogram object for plotting using ggplot. — dendrogram_data","text":"x object class \"dendrogram\", e.g. output .dendrogram() type type plot, indicating shape dendrogram: \"rectangle\" draw rectangular lines, \"triangle\" draw triangular lines. ... ignored","code":""},{"path":[]},{"path":"/reference/get_data_tree_leaf_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"Extract labels data frame tree object plotting using ggplot","code":""},{"path":"/reference/get_data_tree_leaf_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"","code":"get_data_tree_leaf_labels(model, uniform, ...)"},{"path":"/reference/get_data_tree_leaf_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":[]},{"path":"/reference/get_data_tree_leaf_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from tree object for plotting using ggplot. — get_data_tree_leaf_labels","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/ggdendro-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"package enables create dendrograms tree plots using ggplot2::ggplot().","code":""},{"path":"/reference/ggdendro-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"ggplot2 philosophy clearly separate data presentation. Unfortunately plot method dendrograms (plot.dendrogram()) plots directly plot device without exposing data. ggdendro package resolves making available functions extract dendrogram plot data. data can used ggplot. function dendro_data() extracts data different objects contain dendrogram information. generic function methods : hclust: dendro_data.hclust() dendrogram: dendro_data.dendrogram() regression trees: dendro_data.tree() partition trees: dendro_data.rpart() agnes diana: dendro_data.twins() methods create object class dendro, consisting list data frames. extract relevant data frames list, can use accessor functions: segment(): line segment data label(): text end segment leaf_label(): leaf labels tree diagram plot dendrogram, either construct plot ggplot2::ggplot() use function ggdendrogram().","code":""},{"path":[]},{"path":"/reference/ggdendro-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create Dendrograms and Tree Diagrams using 'ggplot2' — ggdendro-package","text":"Andrie de Vries - apdevries@gmail.com","code":""},{"path":"/reference/ggdendrogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates dendrogram plot using ggplot. — ggdendrogram","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"convenience function","code":""},{"path":"/reference/ggdendrogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"","code":"ggdendrogram( data, segments = TRUE, labels = TRUE, leaf_labels = TRUE, rotate = FALSE, theme_dendro = TRUE, ... )"},{"path":"/reference/ggdendrogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"data Either dendro object object can coerced class dendro using dendro_data() function, .e. objects class dendrogram, hclust tree segments TRUE, show line segments labels TRUE, shows segment labels leaf_labels TRUE, shows leaf labels rotate TRUE, rotates plot 90 degrees theme_dendro TRUE, applies blank theme plot (see theme_dendro()) ... parameters passed ggplot2::geom_text()","code":""},{"path":"/reference/ggdendrogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"ggplot2::ggplot() object","code":""},{"path":[]},{"path":"/reference/ggdendrogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates dendrogram plot using ggplot. — ggdendrogram","text":"","code":"### Demonstrate ggdendrogram library(ggplot2) hc <- hclust(dist(USArrests), \"ave\") # Demonstrate plotting directly from object class hclust p <- ggdendrogram(hc, rotate = FALSE) print(p) ggdendrogram(hc, rotate = TRUE) # demonstrate converting hclust to dendro using dendro_data first hcdata <- dendro_data(hc) ggdendrogram(hcdata, rotate = TRUE, size = 2) + labs(title = \"Dendrogram in ggplot2\")"},{"path":"/reference/is.dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests whether an object is of class dendro. — is.dendro","title":"Tests whether an object is of class dendro. — is.dendro","text":"dendro? Tests whether object class dendro.","code":""},{"path":"/reference/is.dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests whether an object is of class dendro. — is.dendro","text":"","code":"is.dendro(x)"},{"path":"/reference/is.dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests whether an object is of class dendro. — is.dendro","text":"x Object check","code":""},{"path":[]},{"path":"/reference/rpart_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"code modified original plot.rpart package rpart.","code":""},{"path":"/reference/rpart_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"","code":"rpart_labels(x)"},{"path":"/reference/rpart_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"list two elements: $labels $leaf_labels","code":""},{"path":[]},{"path":"/reference/rpart_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from rpart object for plotting using ggplot. — rpart_labels","text":"Original author Brian Ripley","code":""},{"path":"/reference/rpart_segments.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"Extract data frame rpart object plotting using ggplot.","code":""},{"path":"/reference/rpart_segments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"","code":"rpart_segments(x, ...)"},{"path":"/reference/rpart_segments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from rpart object for plotting using ggplot. — rpart_segments","text":"... ignored","code":""},{"path":[]},{"path":"/reference/rpartco.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute the x-y coordinates for a tree. — rpartco","title":"Compute the x-y coordinates for a tree. — rpartco","text":"Compute x-y coordinates tree.","code":""},{"path":"/reference/rpartco.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute the x-y coordinates for a tree. — rpartco","text":"","code":"rpartco(tree, parms)"},{"path":"/reference/rpartco.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute the x-y coordinates for a tree. — rpartco","text":"tree Tree model parms Graphics parameters","code":""},{"path":"/reference/segment.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns segment, label or leaf-label data from dendro object. — segment","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"segment extracts line segments, label extracts labels, leaf_label extracts leaf labels dendro object.","code":""},{"path":"/reference/segment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"","code":"segment(x) label(x) leaf_label(x)"},{"path":"/reference/segment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns segment, label or leaf-label data from dendro object. — segment","text":"x dendro object","code":""},{"path":[]},{"path":"/reference/theme_dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates completely blank theme in ggplot. — theme_dendro","title":"Creates completely blank theme in ggplot. — theme_dendro","text":"Sets ggplot options blank, returning blank theme elements panel grid, panel background, axis title, axis text, axis line axis ticks.","code":""},{"path":"/reference/theme_dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates completely blank theme in ggplot. — theme_dendro","text":"","code":"theme_dendro()"},{"path":"/reference/tree_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"Extract labels data frame tree object plotting using ggplot.","code":""},{"path":"/reference/tree_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"","code":"tree_labels(model, uniform, ...)"},{"path":"/reference/tree_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":"/reference/tree_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"list two elements: $labels $leaf_labels","code":""},{"path":[]},{"path":"/reference/tree_labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract labels data frame from tree object for plotting using ggplot. — tree_labels","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/tree_segments.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data frame from tree object for plotting using ggplot. — tree_segments","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"Extract data frame tree object plotting using ggplot.","code":""},{"path":"/reference/tree_segments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"","code":"tree_segments(model, uniform, ...)"},{"path":"/reference/tree_segments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"model object class \"tree\", e.g. output tree() ... ignored","code":""},{"path":[]},{"path":"/reference/tree_segments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract data frame from tree object for plotting using ggplot. — tree_segments","text":"Code modified original Brian Ripley","code":""},{"path":"/reference/treeco.html","id":null,"dir":"Reference","previous_headings":"","what":"Function copied from tree:::treeco. — treeco","title":"Function copied from tree:::treeco. — treeco","text":"Function copied tree:::treeco.","code":""},{"path":"/reference/treeco.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function copied from tree:::treeco. — treeco","text":"","code":"treeco(tree, uniform)"},{"path":"/reference/treeco.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function copied from tree:::treeco. — treeco","text":"tree tree object uniform ???","code":""},{"path":"/news/index.html","id":"ggdendro-020","dir":"Changelog","previous_headings":"","what":"ggdendro 0.2.0","title":"ggdendro 0.2.0","text":"Bug fix: Fix longstanding bug plotting large amounts data used caused node overflow (#27) : Fix deprecated ggplot() aes usage Small documentation fixes comply stricter CRAN testing","code":""},{"path":"/news/index.html","id":"ggdendro-0123","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.23","title":"ggdendro 0.1.23","text":"CRAN release: 2022-02-16 functional changes. Minor changes comply CRAN policy.","code":""},{"path":"/news/index.html","id":"ggdendro-0122","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.22","title":"ggdendro 0.1.22","text":"CRAN release: 2020-09-13 functional changes Update tests conform testthat_3.0.0","code":""},{"path":"/news/index.html","id":"ggdendro-0121","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1.21","title":"ggdendro 0.1.21","text":"CRAN release: 2020-08-11 Bug fixes: Fix alignment leaf labels rotate=FALSE #28 changes Re-styled files follow tidyverse style guide Added pkgdown site http://andrie.github.io/ggdendro/ Added spellcheck fixed spelling mistakes","code":""},{"path":"/news/index.html","id":"ggdendro-01-20","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-20","title":"ggdendro 0.1-20","text":"CRAN release: 2016-04-27 Enhancements: Don’t open plot device calculation segment data #25","code":""},{"path":"/news/index.html","id":"ggdendro-01-19","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-19","title":"ggdendro 0.1-19","text":"Bug fix release. Functional changes: Removed margin argument dendro_data.rpart, since effect plot. Bug fixes: Fixed issue #20: Plot data dependent device, causing errors spurious new devices Fixed issue #24: Labels don’t print ggdendrogram() package scales_0.4 Fixed issue #22: Margin working dendro_data.rpart","code":""},{"path":"/news/index.html","id":"ggdendro-01-16","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-16","title":"ggdendro 0.1-16","text":"New functionality: Added support objects class twins packages cluster, specifically agnes diana objects (pull request #14 @unikum) Fixes: - Many small changes improvements documentation","code":""},{"path":"/news/index.html","id":"ggdendro-01-15","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-15","title":"ggdendro 0.1-15","text":"CRAN release: 2014-09-29 New functionality: - None Changes: bug fixes Unit tests now run R CMD check Modified vignette use knitr instead SWeave","code":""},{"path":"/news/index.html","id":"ggdendro-01-14","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-14","title":"ggdendro 0.1-14","text":"CRAN release: 2013-09-03 New functionality * Added support rpart Changes: * Modified code suggest tree, rather import * Changed plot behaviour ggdendrogram() prettier axis labels * Removed references hidden functions package stats","code":""},{"path":"/news/index.html","id":"ggdendro-01-12","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-12","title":"ggdendro 0.1-12","text":"CRAN release: 2013-01-28 New functionality * None Changes: * ggdendro now imports MASS, tree ggplot2 (rather suggests) * Added Brian D. Ripley author (original author package tree)","code":""},{"path":"/news/index.html","id":"ggdendro-01-09","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-09","title":"ggdendro 0.1-09","text":"New functionality * None Changes: * Removed support rpart * Changed Licence GPL (>=2) GPL-2|GPL-3 conform rtree license conditions","code":""},{"path":"/news/index.html","id":"ggdendro-01-07","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-07","title":"ggdendro 0.1-07","text":"New functionality: None Changes: Modified code conform ggplot2 v0.9.2","code":""},{"path":"/news/index.html","id":"ggdendro-01-04","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-04","title":"ggdendro 0.1-04","text":"New functionality: None Modified examples conform ggplot2 v0.9","code":""},{"path":"/news/index.html","id":"ggdendro-01-02","dir":"Changelog","previous_headings":"","what":"ggdendro 0.1-02","title":"ggdendro 0.1-02","text":"New functionality: Added support classification trees using package:rpart Fixed bugs: * Classification trees using tree produced error due attempted rounding factor variables Changes API * Fixed inconsistencies names data.frame segments. names now always x, y, xend yend","code":""},{"path":"/news/index.html","id":"ggdendro-00-7","dir":"Changelog","previous_headings":"","what":"ggdendro 0.0-7","title":"ggdendro 0.0-7","text":"New functionality * Included ggdendrogram function conveniently creates ggplot dendrogram single line code. * Created theme_dendro, almost blank theme","code":""},{"path":"/news/index.html","id":"ggdendro-00","dir":"Changelog","previous_headings":"","what":"ggdendro 0.0","title":"ggdendro 0.0","text":"Experimental release package. Supports extraction plot data following classes: dendrogram tree hclust","code":""}]
diff --git a/sitemap.xml b/sitemap.xml
index 4ada7b9..258a3c4 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -51,9 +51,6 @@
/reference/is.dendro.html
-
- /reference/labels.rpart.html
-
/reference/rpart_labels.html