Get adjacency or edgelist representation of the network
stored as `igraph`

object.

1 2 3 | ```
as.matrix.igraph(x,
matrix.type = c("adjacency", "edgelist"),
attrname = NULL, sparse = FALSE, ...)
``` |

`x` |
object of class igraph, the network |

`matrix.type` |
character, type of matrix to return, currently "adjacency" or "edgelist" are supported |

`attrname` |
character, name of the edge attribute to use to fill in the cells of the adjacency matrix |

`sparse` |
logical, whether to return a sparse matrix |

`...` |
other arguments to/from other methods |

If `matrix.type`

is "edgelist" a two-column numeric
edgelist matrix is returned. The value of
`attrname`

is ignored.

If `matrix.type`

is "adjacency" then a square
adjacency matrix is returned. If `attrname`

is
`NULL`

(default) the matrix is binary. Otherwise
`attrname`

can be a name of edge attribute of
`x`

. In that case the cells of the results are the
values of that attribute.

Other arguments passed through `...`

are passed to
either `get.adjacency`

or
`get.edgelist`

depending on the value
of `matrix.type`

.

Depending on the value of `matrix.type`

either a
square adjacency matrix or a two-column numeric matrix
representing the edgelist.

`get.adjacency`

,
`get.edgelist`

1 2 3 4 5 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.