curve_ball: Curbe ball algorithm to generate random networks with given...

View source: R/models.r

curve_ballR Documentation

Curbe ball algorithm to generate random networks with given an igraph network

Description

This extract the adjacency matrix from an igraph object and generates a randomized version of the network with the same row and column totals, the results have the same in and out degree sequence than the original network. The diagonals are not avoided so it can generate self-links or cannibalism in the context of food-webs. In the case that the network has multiple components (or disconnected networks) the algorithm simulates around the same number of components, if the original network has 1 component the algorithm enforces that the results have all 1 component. If the edge attribute weight is present and istrength=TRUE then the weigth is additionally randomized keeping the column sum equal to the original matrix.

Usage

curve_ball(g, nsim = 1000, istrength = FALSE)

Arguments

g

igraph object to extract adjacency matrix

nsim

number of generated random networks

istrength

if TRUE the edge attribute weight is taken as interaction strength and randomized keeping the column sum equal to the original matrix.

Details

Based on:

Value

a list of randomized igraph objects

References

Strona, G. et al. 2014. A fast and unbiased procedure to randomize ecological binary matrices with fixed row and column totals. -Nat. Comm. 5: 4114. doi: 10.1038/ncomms5114

Examples


curve_ball(netData[[1]])


lsaravia/EcoNetwork documentation built on March 20, 2024, 3:27 p.m.