Find all nodes upstream of a given node.

sbn_get_upstream(g, node)

Arguments

g

a river network as an igraph object. Must be a downstream directed graph.

node

target node to get all upstream nodes of.

Value

A vector of upstream node id's.

Examples

g <- sbn_create(10, 0.7)
sbn_get_upstream(g, 2)
#> [1]  4  5  6  7  8  9 10