Learn R Programming

ConsRankClass (version 1.0.1)

treepaths: Path of a terminal node

Description

Given an object of the class "ranktree", it extracts the paths of all terminal nodes

Usage

treepaths(Tree)

Arguments

Tree

An object of the class "ranktree"

Value

A list containing:

leaves the number of the terminal nodes
size the sample size within each terminal nodes

See Also

ranktree, nodepath, getsubtree

Examples

Run this code
# NOT RUN {
data(Irish)
#build the tree with default options
tree <- ranktree(Irish$rankings,Irish$predictors)
#get information about all the paths leading to terminal nodes
paths <- treepaths(tree)
#
#the terminal nodes
paths$leaves
#
#sample size within each terminal node
paths$size
#
#visualize the path of the second leave (terminal node number 8)
paths$paths[[2]]
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab