Graph to Matrix coersions       package:graph       R Documentation

_C_o_e_r_c_i_n_g _m_a_t_r_i_c_e_s _t_o _g_r_a_p_h_s

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

     Functions for converting graph objects into matrices

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

     A 'graphNEL' can be directly coerced into a 'adjacency' matrix
     using the 'as' method. If the graph is 'undirected' then the
     matrix will by symmetric.

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

     An adjacency  For 'aM2bpG', an object of class 'graphNEL'.  For
     'ftM2adjM', an adjacency matrix representation of the coerced
     graph.

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

     Byron Ellis

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

     From <- matrix(sample(c(0,1),16,replace=TRUE),ncol=4,nrow=4)
     dimnames(From) <- list(LETTERS[1:4],LETTERS[1:4])
     To <- as(From,"graphNEL")
     Back <- as(To,"matrix")
     if(sum(From == Back) != 16) warning("conversion failed")

