rnet.SmWorld: Call 'igraph::sample_smallworld' to Generate Random Graph...

View source: R/network_distributions.R

rnet.SmWorldR Documentation

Call igraph::sample_smallworld to Generate Random Graph Object from the Watts-Strogatz Small-World Model

Description

Call igraph::sample_smallworld and convert the output to simcausal network matrix. The parameters are the same as those of igraph::sample_smallworld. The loop edges aren't allowed (loops = FALSE) and the multiple edges aren't allowed either multiple = FALSE.

Usage

rnet.SmWorld(n, dim, nei, p)

Arguments

n

Size of the network graph (the number of nodes).

dim

Same as in igraph::sample_smallworld: Integer constant, the dimension of the starting lattice.

nei

Same as in igraph::sample_smallworld: Integer constant, the neighborhood within which the vertices of the lattice will be connected.

p

Same as in igraph::sample_smallworld: Real constant between zero and one, the rewiring probability.

Value

A matrix with n rows, each row lists the indices of friends connected to that particular observation.

See Also

rnet.gnp, rnet.gnm


osofr/simcausal documentation built on Oct. 21, 2022, 3:09 a.m.