get.incidence             package:igraph             R Documentation

_I_n_c_i_d_e_n_c_e _m_a_t_r_i_x _o_f _a _b_i_p_a_r_t_i_t_e _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     This function can return a sparse of dense incidence matrix of a
     bipartite network. The incidence matrix is an n times m matrix, n
     and m are the number of vertices of the two kinds.x

_U_s_a_g_e:

     get.incidence(graph, types=NULL, attr=NULL, names=TRUE, sparse=FALSE)

_A_r_g_u_m_e_n_t_s:

   graph: The input graph. The direction of the edges is ignored in
          directed graphs.

   types: An optional vertex type vector to use instead of the ''type''
          vertex attribute. You must supply this argument if the graph
          has no ''type'' vertex attribute.

    attr: Either 'NULL' or a character string giving an edge attribute
          name. If 'NULL' a traditional incidence matrix is returned.
          If not 'NULL' then the values of the given edge attribute are
          included in the incidence matrix. If the graph has multiple
          edges, the edge attribute of an arbitrarily chosen edge (for
          the multiple edges) is included.

   names: Logical scalar, if 'TRUE' and the vertices in the graph are
          named (i.e. the graph has a vertex attribute called
          ''name''), then vertex names will be added to the result as
          row and column names. Otherwise the ids of the vertices are
          used as row and column names.

  sparse: Logical scalar, if it is 'TRUE' then a sparse matrix is
          created, you will need the 'Matrix' package for this.

_D_e_t_a_i_l_s:

     Bipartite graphs have a ''type'' vertex attribute in igraph, this
     is boolean and 'FALSE' for the vertices of the first kind and
     'TRUE' for vertices of the second kind.

     The vertex ids corresponding to rows and columns in the incidence
     matrix are returned as row/column names.

_V_a_l_u_e:

     A sparse or dense matrix.

_A_u_t_h_o_r(_s):

     Gabor Csardi csardi@rmki.kfki.hu

_S_e_e _A_l_s_o:

     'graph.incidence' for the opposite operation.

_E_x_a_m_p_l_e_s:

     g <- graph.bipartite( c(0,1,0,1,0,0), c(0,1,1,2,2,3) )
     get.incidence(g)

