igraph::sample_smallworld
to Generate Random Graph Object from the Watts-Strogatz Small-World ModelCall 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
.
rnet.SmWorld(n, dim, nei, p)
A matrix with n rows, each row lists the indices of friends connected to that particular observation.
Size of the network graph (the number of nodes).
Same as in igraph::sample_smallworld
: Integer constant, the dimension of the starting lattice.
Same as in igraph::sample_smallworld
: Integer constant, the neighborhood within which the vertices of the lattice will be connected.
Same as in igraph::sample_smallworld
: Real constant between zero and one, the rewiring probability.
rnet.gnp
, rnet.gnm