set_graph_directionality {riverconn}R Documentation

Create directed river graph based on outlet flag

Description

The input graph can be either directed or undirected. If directed, then it is made undirected before directionality is assigned.

Usage

set_graph_directionality(graph, field_name = "name", outlet_name)

Arguments

graph

an 'igraph' object representing a river structure where reaches are nodes and confluences (or fragmentation items) are links.

field_name

a character value that flags the vertices attribute used to designate the outlet. Each vertex must have an unique value for this field.

outlet_name

a character value corresponding to the 'field_name' attribute

Value

an object of class 'igraph' containing a directed graph.

Examples

library(igraph)
g <- igraph::graph_from_literal(1-2, 2-4, 3-2, 4-6, 6-7, 5-6, 7-8, 9-5, 10-5 )
g1 <- set_graph_directionality(g, field_name = "name", "8")


[Package riverconn version 0.3.31 Index]