View source: R/set_graph_directionality.R
set_graph_directionality | R Documentation |
The input graph can be either directed or undirected. If directed, then it is made undirected before directionality is assigned.
set_graph_directionality(graph, field_name = "name", outlet_name)
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 |
an object of class 'igraph' containing a directed graph.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.