This function calculates the different statistics of the mid summer drought from a Time Series.
The input must be in the form of daily data, with the first data point being January 1st of a respective year.
Arguments
- x
Filtered xts data (from msdFilter)
- dates
Vector of Dates (from the msdDates function)
- fcn
Specify what values to be pulled from the function.
Options are 'duration', 'intensity', 'firstMaxValue', 'secondMaxValue', 'min', 'mindex'.
Value
SpatRaster or TimeSeries of Yearly data
Examples
data("timeseries")
ts <- timeseries
dates <- zoo::index(ts)
filteredData <- msdrought::msdFilter(ts, window = 31, quantity = 2)
keyDates <- msdDates(dates)
msdrought::msdStats(filteredData, keyDates, fcn = "duration")
#> [1] 76 126 84 97 174