accumulate_downstream: Accumulate Variable Downstream

View source: R/accumulate_downstream.R

accumulate_downstreamR 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)

hydroloom documentation built on Sept. 29, 2023, 5:09 p.m.