lpdates2: Pulling Dates

Description Usage Arguments Value Examples

View source: R/lpdates2.R

Description

This function pulls the dates that correspond with the Mid Summer Drought, and is used in conjuction with the MSD function.

Usage

1
lpdates2(x, year1=1981, date1="05-01", date2="06-01", date3="08-31", date4="10-31")

Arguments

x

Date vector

year1

The year the Date vector starts on

date1

Start index to find first onset date

date2

End index to find first onset date

date3

Start index to find second onset date

date4

End index to find second onset date

Value

A vector of indexes that correspond to the four dates every year, with respect to the start date.

NOTE: It would be significantly easier to save the output as a variable called 'dated', especially when using rasters so that you do not have to create an intermediate function.

Examples

1
2
dates<-seq(from = as.Date("1981-01-01"), to = as.Date("2020-12-31"), by = "day") 
lpdates2(dates, year1=1981, date1="05-01", date2="06-01", date3="08-31", date4="10-31")

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