birewire.bipartite.from.incidence {BiRewire} | R Documentation |
This function creates an igraph
bipartite graph from an incidence matrix.
birewire.bipartite.from.incidence(matrix,directed=FALSE)
matrix |
incidence matrix: an (n-by-m) binary matrix where rows correspond to vertices in the frist class while columns correspond to vertices in the second one; |
directed |
Logical, if TRUE a directed graph is created. |
The function calls graph.incidence
of package igraph
. See igraph
documentation for more details.
Bipartite igraph graph.
Andrea Gobbi
Maintainer: Andrea Gobbi <gobbi.andrea@mail.com>
Csardi, G. and Nepusz, T (2006) The igraph software package for complex network research, InterJournal, Complex Systems url http://igraph.sf.net
library(igraph) library(BiRewire) g <- graph.bipartite( rep(0:1,length=10), c(1:10)) ##gets the incidence matrix of g m<-as.matrix(get.incidence(graph=g)) ##rewire the current graph m2=birewire.rewire.bipartite(m,100) #create the rewired bipartite graph g2<-birewire.bipartite.from.incidence(m2,TRUE)