ggDiagnose.tree: Diagnostic plot for 'tree' object ('ggplot2' based)

Description Usage Arguments Value Examples

View source: R/tree.R

Description

Utilizing work from Andie de Vries's function dendro_data.tree from the ggdendro package which is used in the dfCompile to create a list of data frames.

Usage

1
2
3
ggDiagnose.tree(x, type = c("proportional", "uniform"),
  split.labels = TRUE, leaf.labels = FALSE, text.size = 3, ...,
  show.plot = TRUE, return = FALSE)

Arguments

x

an object of class tree from the tree.

type

character string. If "uniform", the branches are of uniform length (only shows depth). Otherwise they are proportional to the decrease in impurity.

split.labels

if TRUE (the default), non-leaf nodes are labeled with splitting rule

leaf.labels

if TRUE, leaves are labeled with predicted value (the default is FALSE).

text.size

integer size for link[ggplot2]{geom_text} for labels.

...

extra attributes (currently not used)

show.plot

logic to display the graphics (group of graphics in this case)

return

logic to return list of graphics and the data frame to make the majority of graphics

Value

depending on show.plot and return it will return the visualization of the graphic and/or a list of both the list of data frames used the make the graphic and the individual graphic object.

Examples

1
2
3
4
5
6
7
library(tree)

tree.object <- tree(Species ~., data = iris)

plot(tree.object)

ggDiagnose.tree(tree.object, split.labels = FALSE)

benjaminleroy/ggDiagnose documentation built on May 4, 2019, 3:07 a.m.