Learn R Programming

SBN (version 1.0.0)

sbn_create: Create SBNs

Description

An SBN river network as a downstream directed igraph object.

Usage

sbn_create(n, p)

Arguments

n

desired number of nodes.

p

branching probability, from 0 - 1. Passed to stats::rbinom(), the probability of success in two attempts at adding upstream branches.

Value

A river network as an igraph object.

Details

SBNs are generated using a stochastic branching process. The network generation process starts from an initial downstream node (the river mouth). At each iteration a random node in the network, with no upstream connections is selected, and zero, one or two nodes are added upstream of it, depending on a branching probability (p). This process is repeated until a pre-determined number of nodes across the entire network is attained (n).

Examples

Run this code
# NOT RUN {
sbn_create(10, 0.7)

# }

Run the code above in your browser using DataLab