rg_w: Random weighted network generator

Description Usage Arguments Value Note Author(s) References Examples

Description

This function creates a classical random network with random edge weights.

Usage

1
rg_w(nodes=100,arcs=300,weights=1,directed=TRUE,seed=NULL)

Arguments

nodes

number of nodes

arcs

number of arcs; if this value is between 0 and 1, a random network where each tie is based on this probability will be produced

weights

A tie weight vector to be randomly sampled.

directed

whether you want a directed or undirected network, values TRUE or FALSE

seed

the random seed. If you want it to be non-reproducable, use NULL otherwise, use a number

Value

Returns a one-mode network with random weights.

Note

version 1.0.0

Author(s)

Tore Opsahl; http://toreopsahl.com

References

http://toreopsahl.com/tnet/

Examples

1
rg_w(nodes=10,arcs=30,directed=FALSE,seed=1)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: survival
tnet: Analysis of Weighted, Two-mode, and Longitudinal networks.
Type ?tnet for help.
    i  j w
1   1  9 1
2   2  4 1
3   2  8 1
4   3  5 1
5   3  7 1
6   3  8 1
7   3  9 1
8   4  2 1
9   4  5 1
10  4  7 1
11  5  3 1
12  5  4 1
13  5  8 1
14  5  9 1
15  5 10 1
16  6  9 1
17  7  3 1
18  7  4 1
19  7  8 1
20  8  2 1
21  8  3 1
22  8  5 1
23  8  7 1
24  9  1 1
25  9  3 1
26  9  5 1
27  9  6 1
28  9 10 1
29 10  5 1
30 10  9 1

tnet documentation built on May 30, 2017, 4:31 a.m.