get_peakThreshold: Function to return a specified flood threshold

View source: R/get_peakThreshold.R

get_peakThresholdR Documentation

Function to return a specified flood threshold

Description

This function calculates flood thresholds for specified recurrence intervals.

Usage

get_peakThreshold(x, peakValues, perc = 0.6, yearType = "water", wyMonth = 10L)

Arguments

x

A dataframe containing a vector of date values in the first column and vector of numeric flow values in the second column.

peakValues

A dataframe containing a vector of date values in the first column and vector of numeric annual peak flow values in the second column.

perc

value containing the desired percentile to be calculated

yearType

A charcter of either "water" or "calendar" indicating whether to use water years or calendar years, respectively.

wyMonth

A numeric. The month of the year in which the water year starts (1=January, 12=December). The water year begins on the first day of wyMonth.

Details

Compute the log10 of the daily flows for the peak annual flow days. Calculate the coefficients for a linear regression equation for logs of peak annual flow versus logs of average daily flow for peak days. Using the log peak flow for the 1.67-year recurrence interval (60th percentile, perc=0.6) as input to the regression equation, predict the log10 of the average daily flow. The threshold is 10 to the log10 (average daily flow) power (cubic feet per second). for the 5-year recurrence interval (80th percentile, perc=0.8), used by indices TL3 and TL4, follow the same process, inputing a different 'perc' value.

Value

thresh numeric containing the flood threshold for recurence interval specified by perc

Examples

## Not run: 
library(dataRetrieval)
x <- sampleData[c("date","discharge")]
sites<-"02178400"
peakValues <- readNWISpeak(sites)
peakValues <- peakValues[c("peak_dt","peak_va")]
get_peakThreshold(x,peakValues,.6,yearType="water")

## End(Not run)

USGS-R/EflowStats documentation built on Sept. 30, 2023, 9:31 p.m.