Learn R Programming

simcausal (version 0.5.7)

rnet.gnp: Call igraph::sample_gnp to Generate Random Graph Object According to the G(n,p) Erdos-Renyi Model

Description

Call igraph::sample_gnp and convert the output to simcausal network matrix.

Usage

rnet.gnp(n, 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 (number of nodes).

p

Same as igraph::sample_gnp: The probability for drawing an edge between two arbitrary vertices (G(n,p) graph).

See Also

rnet.gnm