cutreeshape           package:apTreeshape           R Documentation

_C_u_t _o_b_j_e_c_t_s _o_f _c_l_a_s_s "_t_r_e_e_s_h_a_p_e"

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

     Prunes or cuts an object of class '"treeshape"' from a specificed
     internal node, either by specifying a top or bottom direction.
     This function returns either the top part or the bottom part of a
     tree.

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

     cutreeshape(tree, node, type)

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

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

    node: An integer representing the node at which the tree will be
          pruned or cut. 'node' should be in the range 1:(treesize-1).

    type: A character string equals to either '"top"' or '"bottom"'.

_D_e_t_a_i_l_s:

     If the 'type' argument is "top", the tree is pruned from 'node'.
     The resulting tips correspond to the ancestral branches present at
     the same height as the given node. New tip labels are assigned to
     the tips.

     If the 'type' specified is "bottom", the subtree under 'node' is
     returned. The tips are not renamed (they keep their former names)
     and the specified 'node' is the root of the new tree.

_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:

     'tipsubtree'

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

     ## Data set provided with the library. Type help(cytochromc) for more infos.
     data(carnivora.treeshape)  
     data(hivtree.treeshape)

     ## Examples of "bottom" cutting:
     bottom.tree=cutreeshape(carnivora.treeshape, 3, "bottom")
     plot(carnivora.treeshape, bottom.tree)
     bottom.tree=cutreeshape(carnivora.treeshape, 8, "bottom")
     plot(carnivora.treeshape, bottom.tree)
       
     ## Examples of "top" pruning:
     top.tree=cutreeshape(hivtree.treeshape, 158, "top")
     plot(hivtree.treeshape, top.tree)

