igraph from/to graphNEL conversion  package:igraph  R Documentation

_C_o_n_v_e_r_t _i_g_r_a_p_h _g_r_a_p_h_s _t_o _g_r_a_p_h_N_E_L _o_b_j_e_c_t_s _o_r _b_a_c_k

_D_e_s_c_r_i_p_t_i_o_n:

     The graphNEL class is defined in the 'graph' package, it is
     another way to represent graphs. These functions are provided to
     convert between the igraph and the graphNEL objects.

_U_s_a_g_e:

     igraph.from.graphNEL(graphNEL, name = TRUE, weight = TRUE,
                   unlist.attrs = TRUE)
     igraph.to.graphNEL(graph)

_A_r_g_u_m_e_n_t_s:

graphNEL: The graphNEL graph.

    name: Logical scalar, whether to add graphNEL vertex names as an
          igraph vertex attribute called ''name''.

  weight: Logical scalar, whether to add graphNEL edge weights as an
          igraph edge attribute called ''weight''. (graphNEL graphs are
          always weighted.)

unlist.attrs: Logical scalar. graphNEL attribute query functions return
          the values of the attributes in R lists, if this argument is
          'TRUE' (the default) these will be converted to atomic
          vectors, whenever possible, before adding them to the igraph
          graph.

   graph: An igraph graph object.

_D_e_t_a_i_l_s:

     'igraph.from.graphNEL' takes a graphNEL graph and converts it to
     an igraph graph. It handles all graph/vertex/edge attributes. If
     the graphNEL graph has a vertex attribute called ''name'' it will
     be used as igraph vertex attribute ''name'' and the graphNEL
     vertex names will be ignored.

     'igraph.to.graphNEL' converts and igraph graph to a graphNEL
     graph. It converts all graph/vertex/edge attributes. If the igraph
     graph has a vertex attribute ''name'', then it will be used to
     assign vertex names in the graphNEL graph. Otherwise igraph vertex
     ids will be used for this purpose.

_V_a_l_u_e:

     'igraph.from.graphNEL' returns an igraph graph object.

     'igraph.to.graphNEL' returns a graphNEL graph object.

_A_u_t_h_o_r(_s):

     Gabor Csardi csardi@rmki.kfki.hu

_S_e_e _A_l_s_o:

     'get.adjacency', 'graph.adjacency', 'get.adjlist' and
     'graph.adjlist'.

_E_x_a_m_p_l_e_s:

     g <- graph.ring(10)
     V(g)$name <- letters[1:10]
     GNEL <- igraph.to.graphNEL(g)
     g2 <- igraph.from.graphNEL(GNEL)
     g2

