Learn R Programming

RQuantLib (version 0.3.2)

holidayList: Calendar functions from QuantLib

Description

The holidayList function evaluates two given dates in the context of the given calendar, and returns a vector that gives the list of holiday between.

Usage

holidayList(calendar="TARGET", from=Sys.Date(),
to = Sys.Date() + 5, includeWeekends = 0)

Arguments

calendar
A string identifying one of the supported QuantLib calendars, see Details for more
from
A vector (or scalar) of Date types.
to
A vector (or scalar) of Date types.
includeWeekends
boolean that indicates whether the calculation should include the weekends. Default = false

Value

  • An vector of dates.

Details

The calendars are coming from QuantLib, and the QuantLib documentation should be consulted for details.

Currently, the following strings are recognised: TARGET (a default calendar), Canada and Canada/Settlement, Canada/TSX, Germany and Germany/FrankfurtStockExchange, Germany/Settlement, Germany/Xetra, Germany/Eurex, Italy and Italy/Settlement, Italy/Exchange, Japan, UnitedKingdom and UnitedKingdom/Settlement, UnitedKingdom/Exchange, UnitedKingdom/Metals, UnitedStates and UnitedStates/Settlement, UnitedStates/NYSE, UnitedStates/GovernmentBond, UnitedStates/NERC.

(In case of multiples entries per country, the country default is listed right after the country itself. Using the shorter form is equivalent.)

References

http://quantlib.org for details on QuantLib.

Examples

Run this code
from <- as.Date("2009-04-07")
to<-as.Date("2009-04-14")
holidayList("UnitedStates", from, to)
to <- as.Date("2009-10-7")
holidayList("UnitedStates", from, to)

Run the code above in your browser using DataLab