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().

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

ausy <- AUSYCalendar() adjust(lubridate::ymd("20120102"), "u", ausy)
#> [1] "2012-01-02"
adjust(lubridate::ymd("20120102"), "f", ausy)
#> [1] "2012-01-03"
adjust(lubridate::ymd("20120102"), "mf", ausy)
#> [1] "2012-01-03"
adjust(lubridate::ymd("20120102"), "p", ausy)
#> [1] "2011-12-30"
adjust(lubridate::ymd("20120102"), "mp", ausy)
#> [1] "2012-01-03"
adjust(lubridate::ymd("20120102"), "ms", ausy)
#> [1] "2012-01-03"