# get.incidence

From igraph v0.5.3
by Gabor Csardi

##### Incidence matrix of a bipartite graph

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

- Keywords
- graphs

##### Usage

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

##### Arguments

- 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
vertex attribute. You must supply this argument if the graph has no`type`

vertex attribute.`type`

- 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 m - names
- Logical scalar, if
`TRUE`

and the vertices in the graph are named (i.e. the graph has a vertex attribute called ), then vertex names will be added to the result as row and column names. Otherwise th`name`

- sparse
- Logical scalar, if it is
`TRUE`

then a sparse matrix is created, you will need the`Matrix`

package for this.

##### Details

Bipartite graphs have a `type`

`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.

##### Value

- A sparse or dense matrix.

##### concept

- Bipartite graph
- Two-mode network
- Incidence matrix

##### See Also

`graph.incidence`

for the opposite operation.

##### Examples

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

*Documentation reproduced from package igraph, version 0.5.3, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.