accumulate_downstream {hydroloom} | R Documentation |
Accumulate Variable Downstream
Description
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. |
Value
vector of the same length as nrow(x)
containing values of var
accumulated downstream
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)
[Package hydroloom version 1.0.2 Index]