View source: R/accumulate_downstream.R
accumulate_downstream | R Documentation |
given a variable, accumulate according to network topology.
accumulate_downstream(x, var)
## S3 method for class 'data.frame'
accumulate_downstream(x, var)
## S3 method for class 'hy'
accumulate_downstream(x, var)
x |
data.frame network compatible with hydroloom_names. |
var |
variable to accumulate. |
vector of the same length as nrow(x)
containing values of var
accumulated downstream
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
x$totDASqKM <- accumulate_downstream(add_toids(x), "AreaSqKM")
plot(x['totDASqKM'], lwd = x$totDASqKM / 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.