dateconverter: dateconverter

Description Usage Arguments Value Examples

View source: R/dateconverter.R

Description

dateconverter makes it easy to create a date vector in R. It offers a simple wrapper using xts functionality to create a vector of dates between a given Start and End date, and then correcting for the chosen frequency transformation.

Usage

1
dateconverter(StartDate, EndDate, Transform)

Arguments

StartDate

A valid as.Date object. This can be given as ymd("2000-01-01") or as.Date("2000-01-01")

EndDate

A valid as.Date object. This can be given as ymd("2000-01-01") or as.Date("2000-01-01")

Transform

This is the days that you want returned. Options include: alldays: All calendar days between the start and end date calendarEOM: Last calendar day of each month between the start and end date weekdays: All weekdays between the start and end date (mon - fri) weekdayEOW: All last weekdays between the start and end date weekdayEOM: All last weekdays of the month between the start and end date weekdayEOQ: All last weekdays of the quarter between the start and end date weekdayEOY: All last weekdays of the year between the start and end date

Value

Path address just built.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "weekdays")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "calendarEOM")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "weekdayEOW")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "weekdayEOM")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "weekdayEOQ")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "weekdayEOY")
dateconverter(as.Date("2000-01-01"),
as.Date("2017-01-01"), "alldays")

## End(Not run)

rmsfuns documentation built on July 8, 2020, 6:18 p.m.