path.rpart               package:rpart               R Documentation

_F_o_l_l_o_w _P_a_t_h_s _t_o _S_e_l_e_c_t_e_d _N_o_d_e_s _o_f _a_n _R_p_a_r_t _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Returns a names list where each element contains the splits on the
     path from the root to the selected nodes.

_U_s_a_g_e:

     path.rpart(tree, nodes, pretty=0, print.it=TRUE)

_A_r_g_u_m_e_n_t_s:

    tree: fitted model object of class 'rpart'.  This is assumed to be
          the result of some function that produces an object with the
          same named components as that returned by the 'rpart'
          function. 

   nodes: an integer vector containing indices (node numbers) of all
          nodes for which paths are desired.  If missing, user selects
          nodes as described below.  

  pretty: an integer denoting the extent to which factor levels in
          split labels will be abbreviated.  A value of (0) signifies
          no abbreviation.  A 'NULL', the default, signifies using
          elements of letters to represent the different factor levels. 

print.it: Logical. Denotes whether paths will be printed out as nodes
          are interactively selected.   Irrelevant if 'nodes' argument
          is supplied. 

_D_e_t_a_i_l_s:

     The function has a required argument as an 'rpart' object  and a
     list of nodes as optional arguments.  Omitting a list of nodes
     will cause the function to  wait  for  the  user  to select  nodes
      from the dendogram.  It will return a list, with one component
     for each node  specified  or  selected. The  component  contains
     the sequence of splits leading to that node.  In the graphical 
     interation,  the  individual paths are printed out as nodes are
     selected.

_V_a_l_u_e:

     A named (by node) list, each element of which contains all the 
     splits  on the path from the root to the specified or selected
     nodes.

_G_r_a_p_h_i_c_a_l _I_n_t_e_r_a_c_t_i_o_n:

     A dendrogram of the 'rpart' object is expected to be visible  on
     the graphics  device, and a graphics input device (eg a mouse) is
     required.  Clicking (the selection button)  on  a  node selects 
     that  node.   This  process  may  be repeated any number of times.
      Clicking the exit button will  stop  the selection process and
     return the list of paths.

_R_e_f_e_r_e_n_c_e_s:

     This function was modified from 'path.tree' in S.

_S_e_e _A_l_s_o:

     'rpart'

_E_x_a_m_p_l_e_s:

     data(kyphosis)
     fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
     summary(fit)
     path.rpart(fit, node=c(11, 22))

