gvectorize                package:sna                R Documentation

_V_e_c_t_o_r_i_z_a_t_i_o_n _o_f _A_d_j_a_c_e_n_c_y _M_a_t_r_i_c_e_s

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

     `gvectorize' takes an input graph stack and converts it into a
     corresponding number of vectors by row concatenation.

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

     gvectorize(mats, mode="digraph", diag=FALSE, censor.as.na=TRUE)

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

    mats: One or more adjacency matrices (in a graph stack) 

    mode: ``digraph'' if data is taken to be directed, else ``graph'' 

    diag: Boolean indicating whether diagonal entries (loops) are taken
          to contain meaningful data 

censor.as.na: If `TRUE', code unused parts of the adjacency matrix as
          `NA's prior to vectorizing; otherwise, unused parts are
          simply removed 

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

     The output of `gvectorize' is a matrix in which each column
     corresponds to an input graph, and each row corresponds to an
     edge.  The columns of the output matrix are formed by simple
     row-concatenation of the original adjacency matrices, possibly
     after removing cells which are not meaningful (if
     `censor.as.na==FALSE').  This is useful when preprocessing edge
     sets for use with `glm' or the like.

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

     An nxk matrix, where n is the number of arcs and k is the number
     of graphs; if `censor.as.na==FALSE', n will be reflect the
     relevant number of uncensored arcs.

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

     Carter T. Butts ctb@andrew.cmu.edu

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

     #Draw two random graphs
     g<-rgraph(10,2)

     #Examine the vectorized form of the adjacency structure
     gvectorize(g)

