Learn R Programming

riverconn (version 0.3.31)

set_graph_directionality: 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)

Value

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

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

Examples

Run this code
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")

Run the code above in your browser using DataLab