Simple Graph Operations         package:ggm         R Documentation

_S_i_m_p_l_e _g_r_a_p_h _o_p_e_r_a_t_i_o_n_s

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

     Finds the vertices, boundary, children, parents of a subset of
     nodes of a graph.

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

     vertices(amat)
     bd(nn, amat)
     ch(nn, amat)
     pa(nn, amat)

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

      nn: a vector of nodes. It may either a numeric vector, or a
          character vector. If it is character vector must be a subset
          of the 'rownames' of the edge matrix.

    amat: a square matrix with dimnames specifying the adjacency matrix
          of the graph

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

     For definitions of the operators see Lauritzen (1996).

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

     'vertices' returns a character vector with the names of the
     vertices of the graph with adjacency matrix 'amat'. The other
     operators return a character vector specifying the boundary or the
     children or the parents of nodes  'nn' in the graph.  This is a
     numeric or a character vector depending on the mode of 'nn'.

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

     Giovanni M. Marchetti

_R_e_f_e_r_e_n_c_e_s:

     Lauritzen, S. (1996). _Graphical models_. Oxford: Clarendon Press.

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

     'UG', 'DAG'

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

     ## find boundary of a subset of nodes of a DAG
     G <- DAG(y ~ x+b+a, b~a, x~a)
     vertices(G)
     bd("b", G)
     bd(c("b", "x"), G)
     bd("x", G)
     bd(c("x","b"), G)
     ## find boundary of a subset of nodes of an UG
     G <- UG(~ y*x*z + z*h*v)
     bd("z", G)
     bd(c("y", "x"), G)
     bd("v", G)
     bd(c("x","v"), G)
     ## children of a subset of nodes of a DAG
     G <- DAG(y ~ x+b+a, b~a, x~a)
     ch("b", G)
     ch(c("b", "x"), G)
     ch("x", G)
     ch(c("a","x"), G)
     ## parents of a subset of nodes of a DAG
     pa("b", G)
     pa(c("b", "x"), G)
     pa("x", G)
     pa(c("x","b"), G)

