View source: R/add_streamorder-level.R
| add_streamorder | R Documentation |
Adds a strahler stream order.
Algorithm: If more than one upstream flowline has an order equal to the maximum upstream order then the downstream flowline is assigned the maximum upstream order plus one. Otherwise it is assigned the maximum upstream order.
To match the NHDPlus algorithm, non-dendritic network connectivity must
be included. All secondary paths will have the stream_order of upstream
primary paths and a stream_calculator value of 0. Secondary paths have
no affect on the order of downstream paths.
add_streamorder(x, status = TRUE)
## S3 method for class 'data.frame'
add_streamorder(x, status = TRUE)
## S3 method for class 'hy'
add_streamorder(x, status = TRUE)
## S3 method for class 'hy_node'
add_streamorder(x, status = TRUE)
## S3 method for class 'hy_flownetwork'
add_streamorder(x, status = TRUE)
## S3 method for class 'hy_topo'
add_streamorder(x, status = TRUE)
x |
data.frame network compatible with hydroloom_names. |
status |
boolean if status updates should be printed. |
Required attributes: id and toid or fromnode, tonode, and divergence
data.frame containing added stream_order and stream_calculator attribute.
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
x <- dplyr::select(x, COMID, FromNode, ToNode, Divergence)
x <- add_streamorder(x)
plot(sf::st_geometry(x), lwd = x$stream_order, col = "blue")
plot(sf::st_geometry(x), lwd = x$stream_calculator, col = "blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.