Learn R Programming

fmdates (version 0.1.4)

adjust: Adjust to good dates

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

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab