View source: R/computeAnnualFlowDurationCurve.R
computeAnnualFlowDurationCurve | R Documentation |
Computes the annual flow duration curve of a river discharge data set.
computeAnnualFlowDurationCurve(data, column, date = "Date")
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 |
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
If the input data tibble is grouped, the duration stats will be computed within each group.
Other Post-processing:
assess_fc_qual()
,
plotAnnualFlowDurationCurve()
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.