birewire.bipartite.from.incidence: Converts an incidence matrix into a bipartite graph.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/BiRewire.R

Description

This function creates an igraph bipartite graph from an incidence matrix.

Usage

1

Arguments

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.

Details

The function calls graph.incidence of package igraph. See igraph documentation for more details.

Value

Bipartite igraph graph.

Author(s)

Andrea Gobbi
Maintainer: Andrea Gobbi <gobbi.andrea@mail.com>

References

Csardi, G. and Nepusz, T (2006) The igraph software package for complex network research, InterJournal, Complex Systems url http://igraph.sf.net

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

BiRewire documentation built on Nov. 8, 2020, 8:09 p.m.