R/compute_frequency_quantile.R
compute_frequency_quantile.Rd
Performs a volume frequency analysis on annual statistics from a daily streamflow data set and calculates a statistic
based on the provided mean ndays and return period of the statistic, defaults to minimum flows. For example, to determine the
7Q10 of a data set, set the roll_days
to 7
and the return_period
to 10
. Function will calculate using
all values in 'Values' column (no grouped analysis), unless specified. Analysis methodology replicates that from
HECSSP. Returns a tibble with statistics.
compute_frequency_quantile( data, dates = Date, values = Value, station_number, roll_days = NA, roll_align = "right", return_period = NA, use_max = FALSE, use_log = FALSE, fit_distr = c("PIII", "weibull"), fit_distr_method = ifelse(fit_distr == "PIII", "MOM", "MLE"), water_year_start = 1, start_year, end_year, exclude_years, months = 1:12, ignore_missing = FALSE )
data  A data frame of data that contains columns of events, flow values, and measures (data type). 

dates  Name of column in 
values  Column in 
station_number  Character string vector of seven digit Water Survey of Canada station numbers (e.g. 
roll_days  Numeric value of the number of days to apply a rolling mean. Required. 
roll_align  Character string identifying the direction of the rolling mean from the specified date, either by the first
( 
return_period  Numeric vector of the estimated time interval, in years, between flow events of a similar size, inverse of probability, used to estimate the frequency statistic. Required. 
use_max  Logical value to indicate using maximums rather than the minimums for analysis. Default 
use_log  Logical value to indicate logscale transforming of flow data before analysis. Default 
fit_distr  Character string identifying the distribution to fit annual data, one of 
fit_distr_method  Character string identifying the method used to fit the distribution, one of 
water_year_start  Numeric value indicating the month ( 
start_year  Numeric value of the first year to consider for analysis. Leave blank to use the first year of the source data. 
end_year  Numeric value of the last year to consider for analysis. Leave blank to use the last year of the source data. 
exclude_years  Numeric vector of years to exclude from analysis. Leave blank to include all years. 
months  Numeric vector of months to include in analysis (e.g. 
ignore_missing  Logical value indicating whether dates with missing values should be included in the calculation. If

A numeric value of the frequency analysis quantile, given the roll_days and return_period.
if (FALSE) { # Working example: # Compute the annual 7day flow value with a 1 in 10 year return interval compute_frequency_quantile(station_number = "08NM116", roll_days = 7, return_period = 10) }