Learn R Programming

tnet (version 0.0.6)

rg_reshuffling_w: Reshuffle of a weighted network

Description

This function randomly resuffles a weighted edgelist.

Usage

rg_reshuffling_w(edgelist, option="weights", directed=NULL, seed=NULL)

Arguments

edgelist
A weighted edgelist
option
what should be reshuffled: 1) weights (default): randomly assigns the weights to the edges; 2) degree: maintain the degree distribution, but changes the contacts randomly.
directed
logical: is the network directed or undirected. Default: NULL
seed
seed for random generator, set if you want random yet reproducable results.

Value

  • Returns a distance matrix.

References

t.opsahl@qmul.ac.uk

Examples

Run this code
## Load sample data
sampledata<-rbind(
c(1,2,4),
c(1,3,2),
c(2,1,4),
c(2,3,4),
c(2,4,1),
c(2,5,2),
c(3,1,2),
c(3,2,4),
c(4,2,1),
c(5,2,2),
c(5,6,1),
c(6,5,1));

## Run the function
rg_reshuffling_w(sampledata, option="weights", directed=FALSE)

Run the code above in your browser using DataLab