bipartite.from.distribution: Generates a bipartite network with given row and column...

Description Usage Arguments Examples

View source: R/bipartite.from.distribution.R

Description

'bipartite.from.distribution' returns a bipartite graph, as an object of the requested class, with row and column degree distributions that approximately follow beta distributions with given parameters.

Usage

1
2
3
4
5
6
7
8
bipartite.from.distribution(
  R,
  C,
  P,
  rowdist = c(1, 1),
  coldist = c(1, 1),
  class = "matrix"
)

Arguments

R

integer: number of rows

C

integer: number of columns

P

numeric: probability of an edge

rowdist

vector length 2: Row degrees will approximately follow a Beta(a,b) distribution

coldist

vector length 2: Column degrees will approximately follow a Beta(a,b) distribution

class

string: the class of the returned backbone graph, one of c("matrix", "Matrix", "sparseMatrix", "igraph", "network")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
B <- bipartite.from.distribution(R = 100, C = 100, P = 0.1,
rowdist = c(1,1), coldist = c(1,1))  #Uniform
B <- bipartite.from.distribution(R = 100, C = 100, P = 0.1,
rowdist = c(1,10), coldist = c(1,10))  #Right-tailed
B <- bipartite.from.distribution(R = 100, C = 100, P = 0.1,
rowdist = c(10,1), coldist = c(10,1))  #Left-tailed
B <- bipartite.from.distribution(R = 100, C = 100, P = 0.1,
rowdist = c(10,10), coldist = c(10,10))  #Normal
B <- bipartite.from.distribution(R = 100, C = 100, P = 0.1,
rowdist = c(10000,10000), coldist = c(10000,10000))  #Constant

backbone documentation built on Sept. 18, 2021, 1:07 a.m.