getAnnualVariables | R Documentation |
Extraction of annual variables (mean, extrema, sd, quantiles, durations...) from a daily or monthly time series.
getAnnualVariables( x, hydroyear = 1:12, variables = NULL, probs = NULL, lowT = NULL, highT = NULL, events = NULL )
x |
data frame, should contain at least three columns named 'month', 'year' and 'value'. If x has a column named 'day', it is interpreted as a daily series. |
hydroyear |
integer vector, hydro-year definition. |
variables |
character vector, requested variables. Available: 'mean','max','min','total','sd'. |
probs |
numeric vector, probabilities (non-exceedance) for requested quantiles. |
lowT |
numeric vector, low thresholds for requested below-threshold durations. |
highT |
numeric vector, high thresholds for requested above-threshold durations. |
events |
integer vector, with same size as x$value, and typically resulting from a call to getOTevents: definition of events. This function returns the annual number of events, and the mean, max, min and duration of each of them. |
A data frame with the following columns:
year
variable
value
DF=cbind(getCalendar(2001:2020),value=rnorm(7305)) # returns nothing - you need to request something! V=getAnnualVariables(DF) # annual mean/max V=getAnnualVariables(DF,variables=c('mean','max')) # seasonal mean/max V=getAnnualVariables(DF,hydroyear=c(12,1,2),variables=c('mean','max')) # seasonal quantiles V=getAnnualVariables(DF,hydroyear=c(12,1,2),probs=c(0.25,0.5,0.75)) # seasonal durations below / above threshold V=getAnnualVariables(DF,hydroyear=c(12,1,2),lowT=c(-1,0),highT=1) # Events events=getOTevents(DF$value,threshold=1,minIEduration=5,IEminval=0) V=getAnnualVariables(DF,hydroyear=c(12,1,2),events=events) # Many variables at once V=getAnnualVariables(DF,hydroyear=c(12,1,2), variables=c('mean','max','min','total','sd'), probs=seq(0.1,0.9,0.1), lowT=c(-3,-2,1,0), highT=c(0,1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.