adjust: Adjust to good dates

Description Usage Arguments Value See Also Examples

View source: R/dates.R

Description

One common financial markets date arithmetic requires a date needs to be rolled to the closest business day following some convention (see [is_valid_bdc()] for further details). Such rolled dates can be determined by calling 'adjust()'.

Usage

1
adjust(dates, bdc, calendar)

Arguments

dates

a vector of dates to adjust.

bdc

the business day convention used to roll the 'dates' if necessary

calendar

an object that inherits from ['Calendar'] or ['JointCalendar'] which is used to determine the goodness of 'dates'

Value

a vector of adjusted dates - good days are unadjusted

See Also

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

Examples

1
2
3
4
5
6
7
ausy <- AUSYCalendar()
adjust(lubridate::ymd("20120102"), "u", ausy)
adjust(lubridate::ymd("20120102"), "f", ausy)
adjust(lubridate::ymd("20120102"), "mf", ausy)
adjust(lubridate::ymd("20120102"), "p", ausy)
adjust(lubridate::ymd("20120102"), "mp", ausy)
adjust(lubridate::ymd("20120102"), "ms", ausy)

ThVWh/ralibr documentation built on April 4, 2018, 4:41 a.m.