treepaths {ConsRankClass}R Documentation

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
paths a list containing all the paths

Author(s)

Antonio D'Ambrosio antdambr@unina.it

See Also

ranktree, nodepath, getsubtree

Examples


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]]




[Package ConsRankClass version 1.0.0 Index]