Learn R Programming

RQuantLib (version 0.3.4)

dayCount: 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

Value

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

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

References

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

Examples

Run this code
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)

Run the code above in your browser using DataLab