Skip to contents

Construct an event hydrograph by linearly connecting pairs of discharge and timing.

Usage

hydrograph(..., unit = 1, env = rlang::caller_env())

Arguments

...

Pairs of discharges and timing separated by ~.

unit

Conversion factor for the time values; single numeric. Useful if, for example, the timing is specified as a proportion of the total event time.

env

Environment for which to search for bindings, in the case that discharge-timing pairs are specified symbolically.

Value

A data frame of two columns: time into the event, and discharge at that time. Returns a tibble if the tibble package is installed.

Examples

# Hydrograph over 10 units of time:
my_hydrograph <- hydrograph(7 ~ 0, 25 ~ 1 / 3, 7 ~ 1, unit = 10)
plot(my_hydrograph, n = 1000)


# Hydrograph spanning 24 hours:
my_hydrograph <- hydrograph(7 ~ 0, 25 ~ 10, 20 ~ 15, 7 ~ 24)
plot(my_hydrograph, n = 1000)