shift: Shifting dates to good dates

Description Usage Arguments Value See Also Examples

View source: R/date-methods.R

Description

The adjust() function rolls dates to the closest good dates. This function shifts dates by a given period and adjusting the resulting dates to a closest good dates following the given business day convention.

Usage

1
2
shift(dates, period, bdc = "u", calendar = EmptyCalendar(),
  eom_rule = TRUE)

Arguments

dates

a vector of dates to shift and adjust

period

an atomic instance of the period class in the sense that only one of its slots should be non-zero. It must also only be a day, month or year period type.

bdc

the business day convention used to roll the dates if necessary (default: "u" - unadjusted)

calendar

an object that inherits from Calendar or JointCalendar which is used to determine the goodness of dates (default: EmptyCalendar())

eom_rule

if one of the dates is the last business day of the month, is being shifted by a month or year period and eom_rule is TRUE then the shifted date is also the last business day of the month (default: TRUE)

Value

a vector of shifted dates

See Also

Other calendar methods: adjust, generate_schedule, is_good, is_valid_bdc, is, locale, tz

Examples

1
2
3
4
library(lubridate)
ausy <- AUSYCalendar()
shift(ymd("20120229"), months(1), "u", ausy, FALSE)
shift(ymd("20120229"), months(1), "u", ausy, TRUE)

fmdates documentation built on May 1, 2019, 10:10 p.m.