Learn R Programming

backbone (version 2.0.0)

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

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

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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab