Learn R Programming

complexNet (version 0.2.0)

init_graph: Initialising a random graph

Description

init_graph takes number of nodes (n) and average degree (deg) to generate a random graph.

Usage

init_graph(n, deg)

# S4 method for numeric,numeric init_graph(n, deg)

Value

Returns an unweighted (binary) adjacency matrix, where each cell represents the presence (1) or absence (0) of an interaction between the row and the column individual.

Arguments

n

Number of nodes in the network

deg

Average degree in the network

Examples

Run this code
init_graph(n = 10, deg = 4)

Run the code above in your browser using DataLab