tipsubtree            package:apTreeshape            R Documentation

_E_x_t_r_a_c_t _a _s_u_b_t_r_e_e _t_h_a_t _c_o_n_t_a_i_n_s _p_r_e-_s_p_e_c_i_f_i_e_d _t_i_p _n_a_m_e_s _o_r _l_a_b_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     'tipsubtree' returns an object of class '"treeshape"' that
     contains pre-specified tip names or labels. The name of the tips
     are conserved. It extracts the smallest tree that contains the
     common ancestors of the given tips.

_U_s_a_g_e:

     tipsubtree(tree, tips, numeric=FALSE)

_A_r_g_u_m_e_n_t_s:

    tree: An object of class '"treeshape"'.

    tips: A vector that contains the names of the tips one want to
          keep. Warning, the names are case-sensitive.

 numeric: An object of class '"logical"'. If 'FALSE', the vector 'tips'
          contains the names of the tips. If 'TRUE', it contains the
          labels of the tips.

_V_a_l_u_e:

     An object of class '"treeshape"'

_A_u_t_h_o_r(_s):

     Michael Blum <michael.blum@imag.fr> 
      Nicolas Bortolussi <nicolas.bortolussi@imag.fr> 
      Eric Durand <eric.durand@imag.fr> 
      Olivier Franois <olivier.francois@imag.fr>

_S_e_e _A_l_s_o:

     'cutreeshape'

_E_x_a_m_p_l_e_s:

       
     ## The universal tree of life provided in the data sets.
     data(universal.treeshape)
       
     ## One might want to extract the tree containing the Animals, the Plants,
     ##      the Aquifex and the Microsporidia
     tree1<-tipsubtree(universal.treeshape,tips=c("Animals", "Aquifex", 
           "Microsporidia", "Plants"))
     plot(universal.treeshape, tree1)

     ## Labels that do not appear in the tree are ignored
     tree2<-tipsubtree(universal.treeshape,tips=c("Human", "Animals", "Aquifex", 
           "Microsporidia", "Plants"))
     plot(universal.treeshape, tree2)
       
     tree3<-tipsubtree(universal.treeshape,tips=c(1,3,7), numeric=TRUE)
     plot(universal.treeshape, tree3)

