treeSize: Returns number of terminal nodes in a tree.

Description Usage Arguments Value Examples

View source: R/other_useful_fns.R

Description

Returns number of terminal nodes in a tree.

Usage

1
treeSize(model)

Arguments

model

A model returned by splineTree(). Also works on any rpart object

Value

The number of terminal nodes in the tree

Examples

1
2
3
4
5
6
7
## Not run: 
split_formula <- ~ HISP + WHITE + BLACK + SEX + HGC_FATHER + HGC_MOTHER + Num_sibs
tree <- splineTree(split_formula, BMI~AGE, 'ID', nlsySample, degree=1,
  df=3, intercept=TRUE, cp=0.006, minNodeSize=20)

## End(Not run)
treeSize(tree)

splinetree documentation built on July 18, 2019, 9:08 a.m.