vlmctree                package:VLMC                R Documentation

_C_o_m_p_u_t_e _t_h_e _t_r_e_e _s_t_r_u_c_t_u_r_e _o_f _a "_v_l_m_c" _o_b_j_e_c_t

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

     Compute the tree representation of a '"vlmc"' object as R 'list'.

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

     vlmctree(x)

     ## S3 method for class 'vtree':
     str(object, ...)
     .vvec2tree(vv, k, chk.lev)

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

x,object: typically the result of 'vlmc(..)'.

      vv: integer vector encoding the fitted vlmc, typically
          'x$vlmc.vec[-1]'.

       k: integer, the alphabet size.

 chk.lev: integer internally used for consistency checking.

     ...: further arguments passed to or from methods.

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

     '.vvec2tree' is the internal (recursive) function building up the
     tree.

     'str.vtree' is a method for the generic 'str' function and
     typically for the output of 'vlmctree()'. For each node, it gives
     the ``parenting level'' in braces and the counts.

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

     A 'list' of 'class' '"vtree"' representing the tree structure
     recursively.

     Each ``node'' of the tree is itself a list with components 

   level: length-2 integer giving the level in {0,1,...}, counted from
          the root (which is '0') and the parenting level, i.e the
          longest branch.

   count: integer vector of length 'k' where 'k' is the number of
          ``letters'' in the alphabet.

   total: equals to 'sum(* $ count)'.

   child: a list (of length 'k') of child nodes or 'NULL' (i.e. not
          there).

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

     Martin Maechler

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

     'vlmc'.

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

     data(presidents)
     dpres <- cut(presidents, c(0,45,70, 100)) # three values + NA
     table(dpres <- factor(dpres, exclude = NULL)) # NA as 4th level

     (vlmc.prc1 <- vlmc(dpres, cut = 1, debug = TRUE))
     str(vv.prc1 <- vlmctree(vlmc.prc1))

