get.tree.levels           package:Rtreemix           R Documentation

_F_u_n_c_t_i_o_n _f_o_r _c_o_n_s_t_r_u_c_t_i_n_g _l_e_v_e_l _v_e_c_t_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Function that assignes to each node the level at which that node
     is in a specific tree ('tree.num') of the mutagenetic trees
     mixture model 'mixture'. The 'start.val' is the number assigned to
     the events pruned from the tree. This usually is the maximum depth
     of the tree with which the tree specified with 'tree.num' will be
     compared.

_U_s_a_g_e:

     get.tree.levels(mixture, tree.num, start.val)

_A_r_g_u_m_e_n_t_s:

 mixture: An object of the class 'RtreemixModel'.

tree.num: A 'numeric' specifying the tree component from 'mixture' used
          for creating the level vector.

start.val: A 'numeric' specifying the number assigned to the pruned
          events.

_V_a_l_u_e:

     The function returns a named 'numeric' vector. Its length equals
     the number of genetic events in 'mixture' minus one (for the
     initial null event which is always on level 0). The vector names
     correspond to the names of the genetic events and each vector
     component gives the level at which the respective event is in the
     'num.tree' tree of 'mixture'.

_A_u_t_h_o_r(_s):

     Jasmina Bogojeska

_S_e_e _A_l_s_o:

     'comp.models', 'comp.trees', 'stability.sim', 
     'RtreemixModel-class', 'fit-methods'

_E_x_a_m_p_l_e_s:

     ## Generate two random RtreemixModel objects each with 3 components.
     rand.mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob =
     c(0.2, 0.8))

     ## Get the tree levels of the 2nd component of the model rand.mod.
     get.tree.levels(mixture = rand.mod, tree.num = 2, start.val = 10)

