dfCompile.tree: Creates a list of data frames for 'tree' objects (for...

Description Usage Arguments Details Value Examples

View source: R/tree.R

Description

This function just a wrapper for ggdendro's dendro_data (look at help(dendro_data.tree)), with slight modifications.

Usage

1
dfCompile.tree(x, type = c("proportional", "uniform"))

Arguments

x

tree object from the package tree

type

type of tree visualization you would like back. If "uniform" the length for each split is the same, otherwise based on the change of impurity ("proportional").

Details

segments

a data frame containing the line segment data

labels

a data frame containing the label text data

leaf_labels

a data frame containing the leaf label text data

Value

returns a list of 3 data frames, see details

Examples

1
2
3
4
5
6
7
8
library(tidyverse)

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

compile.df.list <- dfCompile.tree(tree.object)
compile.df.list %>% names

for (df.name in names(dfCompile.tree)) print(compile.df.list[["df.name"]])

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