get.incidence {igraph} | R Documentation |
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
get.incidence(graph, types=NULL, attr=NULL, names=TRUE, sparse=FALSE)
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
‘ |
attr |
Either |
names |
Logical scalar, if |
sparse |
Logical scalar, if it is |
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.
A sparse or dense matrix.
Gabor Csardi csardi@rmki.kfki.hu
graph.incidence
for the opposite operation.
g <- graph.bipartite( c(0,1,0,1,0,0), c(0,1,1,2,2,3) ) get.incidence(g)