dayCount {RQuantLib}R Documentation

DayCounter functions from QuantLib

Description

The dayCount function returns the number of day between two dates given a day counter Enum

Usage

dayCount(startDates, endDates, dayCounters)

Arguments

startDates A vector of Date type.
endDates A vector of Date type.
dayCounters A vector of numeric type. See Enum

Details

The day counters are coming from QuantLib, and the QuantLib documentation should be consulted for details. See Enum and http://quantlib.org/reference/class_quant_lib_1_1_day_counter.html

Value

A numeric vector contains the number of day between two dates from the input.

Note

The interface might change in future release as QuantLib stabilises its own API.

Author(s)

Dirk Eddelbuettel edd@debian.org for the R interface; Khanh Nguyen nguyen.h.khanh@gmail.com for the implementation; the QuantLib Group for QuantLib

References

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

Examples

  startDates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"),
by=1)
endDates <- seq(from=as.Date("2009-11-07"), to=as.Date("2009-11-14"), by=1)
dayCounters <- c(0,1,2,3,4,5,6,1)
dayCount(startDates, endDates, dayCounters)

[Package RQuantLib version 0.3.2 Index]