lpdates4: Pulling Dates 2

Description Usage Arguments Value Examples

View source: R/lpdates4.R

Description

This function pulls the the first and last day of every year of the date vector.

Usage

1
lpdates2(x, year1=1981, date1="01-01", date2="12-31")

Arguments

x

Date vector

year1

The year the Date vector starts on

date1

January 1st

date2

December 31st

Value

A vector of indexes that correspond to the two 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") 
lpdates4(dates, year1=1981, date1="01-01", date2="12-31")

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