blockTreeToList         package:dynamicGraph         R Documentation

_E_x_t_r_a_c_t _t_h_e _l_i_s_t _o_f _b_l_o_c_k_s _f_r_o_m _a _b_l_o_c_k _t_r_e_e

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

     Returns the list of blocks from a block tree.

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

     blockTreeToList(tree)

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

    tree: The 'BlockTree' part of the result of 'setTreeBlocks'. 

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

     A list of blocks, each block of class 'dg.Block'.

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

     Jens Henrik Badsberg

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

     Block.tree <- list(label = "W", Vertices = c("contry"),
                        X = list(Vertices = c("sex", "race"),
                                 A = list(Vertices = c("hair", "eye"),
                                          horizontal = FALSE),
                                 B = list(Vertices = c("age"),
                                          C = list(Vertices = c("education")))))
     Names <- unlist(Block.tree)
     Names <- Names[grep("Vertices", names(Names))]
     Types <- rep("Discrete", length(Names))
     vertices <- returnVertexList(Names, types = Types)
     blocktree <- setTreeBlocks(Block.tree, vertices)
     Labels(blockTreeToList(blocktree$BlockTree))

