computeAnnualFlowDurationCurve: Computes the annual flow duration curve of a river discharge...

View source: R/computeAnnualFlowDurationCurve.R

computeAnnualFlowDurationCurveR Documentation

Computes the annual flow duration curve of a river discharge data set.

Description

Computes the annual flow duration curve of a river discharge data set.

Usage

computeAnnualFlowDurationCurve(data, column, date = "Date")

Arguments

data

Tibble with date and discharge in columns.

column

Name of the column with data to calculate duration curve from.

date

Name of the date column

Value

Input tibble with sorted data and duration stats in columns, namely
Q: Discharge in descending order
Ma: A day counter between 1 and 365/366
Pa: Exceedance probability in percent

Note

If the input data tibble is grouped, the duration stats will be computed within each group.

See Also

Other Post-processing: assess_fc_qual(), plotAnnualFlowDurationCurve()

Examples

# Monthly flow duration curve
Qdf <- tibble::tibble(
  Date = seq.Date(from = lubridate::as_date("2020-01-01"),
                  to = lubridate::as_date("2022-12-13"),
                  by = "month"),
  Q = rep(c(1:6, 6:1), 3)
)
DurationCurve <- computeAnnualFlowDurationCurve(Qdf, "Q", "Date")
plot(DurationCurve$Ma, DurationCurve$Q)

# Daily flow duration curve
Date = seq.Date(from = lubridate::as_date("2019-10-01"),
                to = lubridate::as_date("2040-09-30"), by = "day")
Qdfdaily <- tibble::tibble(Date = Date,
  Q = sin(2*pi/365*c(1:length(Date))) * stats::runif(length(Date)) +
    cos(2*pi/365*c(1:length(Date))) * runif(length(Date)) +
    runif(length(Date))*2)
DurationCurve <- computeAnnualFlowDurationCurve(Qdfdaily, "Q", "Date")

hydrosolutions/riversCentralAsia documentation built on Feb. 7, 2023, 4:50 p.m.