compute_upstream_aggregate: Computes an aggeregate value for all upstream segments

View source: R/compute_upstream_aggregate.R

compute_upstream_aggregateR Documentation

Computes an aggeregate value for all upstream segments

Description

Function returns the river network consisting of all upstream segments from the specified river segment.

Usage

compute_upstream_aggregate(
  HS,
  values,
  fun = sum,
  output_col = NULL,
  verbose = FALSE,
  ...
)

Arguments

HS

a HS object obtained passed through river_network.

values

A vector of values to be aggregated, or a name of the column in HS storing the values. If the input is a units object, the unit is preserved.

fun

Function applied to the collected values upstream. The function must take na.rm argument.

output_col

Column name in HS where the collected values will be stored. if NULL, the function returns the collected values as a vector.

verbose

Whether or not print progress indicators.

...

Additional arguments passed to fun.

Value

A vector of the collected stats, or the input HS with a specified column storing the vector.


mkkallio/hydrostreamer documentation built on Oct. 14, 2023, 9:38 p.m.