treepaths {ConsRankClass} | R Documentation |
Given an object of the class "ranktree", it extracts the paths of all terminal nodes
treepaths(Tree)
Tree |
An object of the class "ranktree" |
A list containing:
leaves | the number of the terminal nodes | |
size | the sample size within each terminal nodes | |
paths | a list containing all the paths |
Antonio D'Ambrosio antdambr@unina.it
ranktree
, nodepath
, getsubtree
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]]