Learn R Programming

simcausal (version 0.5.7)

rnet.SmWorld: 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)

Value

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

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.

See Also

rnet.gnp, rnet.gnm