simnetwork: Simulating network data

View source: R/auxfunc.R

simnetworkR Documentation

Simulating network data

Description

simnetwork simulates adjacency matrices.

Usage

simnetwork(dnetwork, normalise = FALSE)

Arguments

dnetwork

is a list of sub-network matrices, where the (i, j)-th position of the m-th matrix is the probability that i be connected to j, with i and j individuals from the m-th network.

normalise

boolean takes TRUE if the returned matrices should be row-normalized and FALSE otherwise.

Value

list of (row-normalized) adjacency matrices.

Examples

# Generate a list of adjacency matrices
## sub-network size
N         <- c(250, 370, 120)  
## distribution
dnetwork  <- lapply(N, function(x) matrix(runif(x^2), x))
## network
G         <- simnetwork(dnetwork)

CDatanet documentation built on June 22, 2024, 11:14 a.m.