msdStats {msdrought}R Documentation

Main Mid Summer Drought Calculation Function

Description

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.

Usage

msdStats(x, dates, fcn)

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")


[Package msdrought version 0.1.0 Index]