View source: R/calc_timingAverage.R
calc_timingAverage | R Documentation |
Calculates 3 indices used to describe the timing of average flow conditions. See Table X in the EflowStats package vignette for a full description of indices.
calc_timingAverage(
x,
yearType = "water",
wyMonth = 10L,
digits = 3,
pref = "mean",
floodThreshold = NULL,
...
)
x |
A dataframe containing a vector of date values in the first column and vector of numeric flow values in the second column. |
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. |
digits |
A numeric. Number of digits to round indice values |
pref |
A character of either "mean" or "median", indicating whether to use mean or median. See details. |
floodThreshold |
Numeric flood threshold as the flow equivalent for a flood recurrence of 1.67 years |
... |
Optional arguments needed for |
Descriptions of indices.
ta1; Constancy. Constancy is computed via the formulation of Colwell (see example in Colwell, 1974). A matrix of values is compiled where the columns are 11 flow categories and the rows are 365 days of the year (no leap years) defined as either calendar or water year. February 29th is removed on leap years. The cell values are the number of times that a flow falls into a category on each day. The categories are listed below. The row totals, column totals, and grand total are computed. Using the equations for Shannon information theory parameters, constancy is computed as 1-(uncertainty with respect to state)/log10(number of state)
log(flow) < .1 x log(mean flow)
.1 x log(mean flow) <= log(flow) < .25 x log(mean flow)
.25 x log(mean flow) <= log(flow) < .5 x log(mean flow)
.5 x log(mean flow) <= log(flow) < .75 x log(mean flow)
.75 x log(mean flow) <= log(flow) < 1.0 x log(mean flow)
1.0 x log(mean flow) <= log(flow) < 1.25 x log(mean flow)
1.25 x log(mean flow) <= log(flow) < 1.5 x log(mean flow)
1.5 x log(mean flow) <= log(flow) < 1.75 x log(mean flow)
1.75 x log(mean flow) <= log(flow) < 2.0 x log(mean flow)
2.0 x log(mean flow) <= log(flow) < 2.25 x log(mean flow)
log(flow) >= 2.25 x log(mean flow)
ta2; Predictability. Predictability is computed from the same matrix as constancy (see example in Colwell, 1974). It is computed as: 1- (uncertainty with respect to interaction of time and state - uncertainty with respect to time)/log10(number of state)
ta3; Seasonal predictability of flooding. Divide years up into 2-month periods (that is, Oct-Nov, Dec-Jan, and so forth). Count the number of flood days (flow events with flows > 1.67-year flood) in each period over the entire flow record. TA3 is the maximum number of flood days in any one period divided by the total number of flood days.
A data.frame of flow statistics
x <- sampleData[c("date","discharge")]
yearType = "water"
floodThreshold = 1158
calc_timingAverage(x=x,yearType = yearType,floodThreshold =floodThreshold)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.