Learn R Programming

networksis (version 1.4)

network.form: Generate a bipartite graph with specified marginals

Description

network.form generates a random bipartite graph with marginals given by user-specified row sums and column sums. These row sums and column sums must be consistent with each other (i.e. the sum of the row sums must be the same as the sum of the column sums).

Usage

network.form(row.sums, col.sums, nsim=1)

Arguments

row.sums
A vector of row sums. These row sums must be natural numbers.
col.sums
A vector of column sums. These column sums must be natural numbers.
nsim
Number of networks to be drawn from the set of all networks with the given marginals.

Value

  • network.form bipartite network object of the randomly generated bipartite graph.

Details

A bipartite graph with specified row sums and column sums is randomly generated and returned.

Examples

Run this code
row.sums <- c(3, 2, 0, 1)
col.sums <- c(2, 2, 1, 1)

bipartite.graph <- network.form(row.sums, col.sums)

Run the code above in your browser using DataLab