buildNodeList           package:Rgraphviz           R Documentation

_A _f_u_n_c_t_i_o_n _t_o _b_u_i_l_d _l_i_s_t_s _o_f _n_o_d_e _a_n_d _e_d_g_e _o_b_j_e_c_t_s

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

     These functions can be used to generate lists of 'pNode' and
     'pEdge' objects from an object of class 'graph'.  These lists can
     then be sent to Graphviz to initialize and layout the graph for
     plotting.

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

     buildNodeList(graph, nodeAttrs = list(), subGList=list(), defAttrs=list())
     buildEdgeList(graph, recipEdges=c("combined", "distinct"),
                   edgeAttrs = list(), subGList=list(), defAttrs=list())

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

   graph: An object of class 'graph'

nodeAttrs: A list of attributes for specific nodes

edgeAttrs: A list of attributes for specific edges

subGList: A list of any subgraphs to be used in Graphviz

recipEdges: How to deal with reciprocated edges

defAttrs: A list of attributes used to specify defaults.

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

     These functions will take either the nodes or the edges of the
     specified graph and generate a list of either 'pNode' or 'pEdge'
     objects.

     The 'recipEdges' argument can be used to specify how to handle
     reciprocal edges.  The default value, 'combined' will combine any
     reciprocated edges into a single edge (and if the graph is
     directed, will by default place an arrowhead on both ends of the
     edge), while the other option is 'distinct' which will draw to
     separate edges.  Note that in the case of an undirected graph,
     every edge of a 'graphNEL' is going to be reciprocal due to
     implementation issues.

     The 'nodeAttrs' and 'edgeAttrs' attribute lists are to be used for
     cases where one wants to set an attribute on a node or an edge
     that is not the default.  In both cases, these are lists with the
     names of the elements corresponding to a particular attribute and
     the elements containing a named vector - the names of the vector
     are names of either node or edge objects and the values in the
     vector are the values for this attribute.

     Note that with the 'edgeAttrs' list, the name of the edges are in
     a particular format where an edge between x and y is named 'x~y'.
     Note that even in an undirected graph that 'x~y' is not the same
     as 'y~x' - the name must be in the same order that the edge was
     defined as having. 

     The 'subGraph' argument can be used to specify a list of subgraphs
     that one wants to use for this plot.  The 'buildXXXList' functions
     will determine if a particular node or edge is in one of the
     subgraphs and note that in the object.

     The 'defAttrs' list is a list used to specify any default values
     that one wishes to use.  The element names corresponde to the
     attribute and the value is the default for that particular
     attribute.

     If there is no default specified in 'defAttrs' for an attribute
     declared in 'nodeAttrs' or 'edgeAttrs', then the latter must have
     a value for every node or edge in the graph.  Otherwise, if a
     default is supplied, that value is used for any node or edge not
     explicitly defined for a particular attribute.

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

     A list of class 'pNode' or 'pEdge' objects.

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

     Jeff Gentry

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

     'agopen', 'link{plot.graph}', 'pNode','pEdge'

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

        set.seed(123)
        V <- letters[1:10]
        M <- 1:4
        g1 <- randomGraph(V, M, .2)

        z <- buildEdgeList(g1)
        x <- buildNodeList(g1)

