View source: R/river_network.R
river_network | R Documentation |
The function adds connectivity information to the input river object. The function assumes that the input river is a "clean" river network: connected segments share a node at the start or end of the segment.
river_network(
river,
next_down = NULL,
previous = NULL,
na_value = NULL,
force = FALSE,
riverID = "riverID",
verbose = FALSE
)
river |
An 'sf' linestring feature representing a river network. |
next_down |
Column with the ID(s) of the next segment rivers flows to |
previous |
Column with the ID(s) of the previous segment river flows from |
na_value |
Value in column |
force |
if the river already has routing information, overwrite it? |
riverID |
A character string which specifies the name of the column in
|
verbose |
Whether or not print progress indicators. |
Returns the river network with class 'HSnetwork' with the following attributes:
riverID: Unique (renamed) river segment identifier.
PREVIOUS: a list of riverID(s) of the previous river segment(s).
NEXT: riverID of the segment where the river flows to.
UP_SEGMENTS: the number of river segments upstream.
## Not run:
library(hydrostreamer)
# load data
data(river)
routed_river <- river_network(river, riverID = "ID", verbose=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.