given a variable, accumulate according to network topology.
Usage
accumulate_downstream(x, var)
# S3 method for class 'data.frame'
accumulate_downstream(x, var)
# S3 method for class 'hy'
accumulate_downstream(x, var)
Arguments
- x
data.frame network compatible with hydroloom_names.
- var
variable to accumulate.
Examples
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)