MSD: Mid Summer Drought

Description Usage Arguments Value See Also Examples

View source: R/msd.R

Description

Calculate different statistics of the mid summer drought from a RasterBrick or 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.

If x is a RasterBrick, then the output is a RasterBrick with a data point for each year. If you would like to find a statistical value of the new rasterbrick, it is recommended to use

r <- raster::calc(x, mean)

If the index vector from lpdates2/lpdates4 is not saved as 'dated'/'dated6', a function will have to be created to use it in raster::calc.

Usage

1
MSD(x, dated1=dated, dated4=dated6, fun="duration")

Arguments

x

RasterBrick or TimeSeries

fun

Specify what values to be pulled from the function. Options include 'duration', 'intensity', 'max1', 'max2', 'min', and 'mindex'.

dated

Index of Dates from the lpdates2 function (should be saved as 'dated')

dated6

Index of Dates from the lpdates4 function (should be saved as 'dated')

Value

RasterBrick or TimeSeries of Yearly data

See Also

raster

Examples

1
2
3
4
5
# using RasterBricks
r<-raster::calc(x, MSD)

# using TimeSeries
r<-MSD(x)

kjoseph654/MSD documentation built on July 8, 2021, 2:13 p.m.