| Type: | Package |
| Title: | R Bindings to the Calendaring Functionality of 'QuantLib' |
| Version: | 0.1.3 |
| Date: | 2025-11-24 |
| Description: | 'QuantLib' bindings are provided for R using 'Rcpp' via an updated variant of the header-only 'Quantuccia' project (put together initially by Peter Caspers) offering an essential subset of 'QuantLib' (and now maintained separately for the calendaring subset). See the included file 'AUTHORS' for a full list of contributors to both 'QuantLib' and 'Quantuccia'. Note that this package provided an initial viability proof, current work is done (via approximately quarterly releases tracking 'QuantLib') in the smaller package 'qlcal' which is generally preferred. |
| URL: | https://github.com/eddelbuettel/rcppquantuccia,https://dirk.eddelbuettel.com/code/rcpp.quantuccia.html |
| BugReports: | https://github.com/eddelbuettel/rcppquantuccia/issues |
| License: | GPL-2 |GPL-3 [expanded from: GPL (≥ 2)] |
| Imports: | Rcpp |
| LinkingTo: | Rcpp, BH |
| RoxygenNote: | 6.0.1 |
| NeedsCompilation: | yes |
| Encoding: | UTF-8 |
| Packaged: | 2025-11-24 18:49:03 UTC; edd |
| Author: | Dirk Eddelbuettel |
| Maintainer: | Dirk Eddelbuettel <edd@debian.org> |
| Repository: | CRAN |
| Date/Publication: | 2025-11-24 19:10:02 UTC |
R Bindings to the Calendaring Functionality of 'QuantLib'
Description
'QuantLib' bindings are provided for R using 'Rcpp' via an updated variant of the header-only 'Quantuccia' project (put together initially by Peter Caspers) offering an essential subset of 'QuantLib' (and now maintained separately for the calendaring subset). See the included file 'AUTHORS' for a full list of contributors to both 'QuantLib' and 'Quantuccia'. Note that this package provided an initial viability proof, current work is done (via approximately quarterly releases tracking 'QuantLib') in the smaller package 'qlcal' which is generally preferred.
Details
The DESCRIPTION file:
| Package: | RcppQuantuccia |
| Type: | Package |
| Title: | R Bindings to the Calendaring Functionality of 'QuantLib' |
| Version: | 0.1.3 |
| Date: | 2025-11-24 |
| Authors@R: | c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("QuantLib Authors", role = "aut")) |
| Description: | 'QuantLib' bindings are provided for R using 'Rcpp' via an updated variant of the header-only 'Quantuccia' project (put together initially by Peter Caspers) offering an essential subset of 'QuantLib' (and now maintained separately for the calendaring subset). See the included file 'AUTHORS' for a full list of contributors to both 'QuantLib' and 'Quantuccia'. Note that this package provided an initial viability proof, current work is done (via approximately quarterly releases tracking 'QuantLib') in the smaller package 'qlcal' which is generally preferred. |
| URL: | https://github.com/eddelbuettel/rcppquantuccia, https://dirk.eddelbuettel.com/code/rcpp.quantuccia.html |
| BugReports: | https://github.com/eddelbuettel/rcppquantuccia/issues |
| License: | GPL (>= 2) |
| Imports: | Rcpp |
| LinkingTo: | Rcpp, BH |
| RoxygenNote: | 6.0.1 |
| NeedsCompilation: | yes |
| Encoding: | UTF-8 |
| Author: | Dirk Eddelbuettel [aut, cre] (ORCID: <https://orcid.org/0000-0001-6419-907X>), QuantLib Authors [aut] |
| Maintainer: | Dirk Eddelbuettel <edd@debian.org> |
Package Content
Index of help topics:
RcppQuantuccia-package R Bindings to the Calendaring Functionality of 'QuantLib'adjust_cpp Compute adjusted datesadvanceDate Advance a dateadvanceUnits_cpp Compute adjusted datesbusinessDaysBetween Compute number of business dates between calendar datescalendars The 'calendars' vector contains all calendar identifiers.getEndOfMonth Compute end-of-monthgetHolidays Compute holidays or business daysgetName Get calendar name, or idisBusinessDay Test for business daysisEndOfMonth Test for end-of-monthisHoliday Test for holidaysisWeekend Test for weekendssetCalendar Set a calendar
Maintainer
Dirk Eddelbuettel <edd@debian.org>
Author(s)
Dirk Eddelbuettel [aut, cre] (ORCID: <https://orcid.org/0000-0001-6419-907X>), QuantLib Authors [aut]
References
Compute adjusted dates
Description
Adjust a vector of dates following a business-day convention
Usage
adjust_cpp(dates, bdc = 0L)adjust(dates, bdc = c("Following", "ModifiedFollowing", "Preceding", "ModifiedPreceding", "Unadjusted", "HalfMonthModifiedFollowing", "Nearest"))Arguments
dates | A Date vector with dates |
bdc | A character variable describing one of several supported values,the C++ version implements expects a corresponding integer value |
Details
This function takes a vector of dates and returns another vector of datesof the same length returning at each position the adjusted date accordingto the selected business-day convention. Currently supported values forthe business day convention are (starting from zero):‘Following’, ‘ModifiedFollowing’, ‘Preceding’,‘ModifiedPreceding’, ‘Unadjusted’, ‘HalfModifiedFollowing’and ‘Nearest’.
Value
A Date vector with dates adjust according to business-day convention
Examples
adjust(Sys.Date()+0:6)Advance a date
Description
Advance a date to the next business day plus an optional shift
Usage
advanceDate(rd, days = 0L)Arguments
rd | A Date object describing the date to be advanced to thenext business day. |
days | An optional integer offset applied to the date |
Details
This function takes a given date and advances it to the next business dayunder the current (global) calendar setting. If an optional offset value isgiven it is applied as well.
Value
The advanced date is returned
Examples
advanceDate(Sys.Date(), 2) # today to the next biz day, plus 2 daysCompute adjusted dates
Description
Advance a vector of dates by a given number of time units
Usage
advanceUnits_cpp(dates, n, unit, bdc, emr)advanceUnits(dates, n, unit = c("Days", "Weeks", "Months", "Years", "Hours", "Minutes", "Seconds", "Milliseconds", "Microseconds"), bdc = c("Following", "ModifiedFollowing", "Preceding", "ModifiedPreceding", "Unadjusted", "HalfMonthModifiedFollowing", "Nearest"), emr = FALSE)Arguments
dates | A Date vector with dates |
n | An integer variable with the number of units to advance |
unit | A character variable describing one of several supported values;the C++ version implements expects a corresponding integer value |
bdc | A character variable describing one of several supported values,the C++ version implements expects a corresponding integer value |
emr | A boolean variable select end-of-month, default is ‘FALSE’ |
Details
This function takes a vector of dates and returns another vector of datesof the same length returning at each position the date advanced by the givennumber of steps in the selected time unit, also respecting a business dayconvention and and of month boolean switch. Currently supported values forthe time unit are ‘Days’, ‘Weeks’, ‘Months’ ‘Years’,‘Hours’, ‘Seconds’, ‘Milliseconds’ and ‘Microseconds’;all are specified as integers. Note that intra-daily units are not currentlysupported for advancing ‘Date’ objects. Currently supported values forthe business day convention are (starting from zero):‘Following’, ‘ModifiedFollowing’, ‘Preceding’,‘ModifiedPreceding’, ‘Unadjusted’, ‘HalfModifiedFollowing’and ‘Nearest’.
Value
A Date vector with dates advanced according to the selected inputs
Examples
advanceUnits(Sys.Date()+0:6, 5, "Days", "Following")Compute number of business dates between calendar dates
Description
Compute the number of business days between dates
Usage
businessDaysBetween(from, to, includeFirst = TRUE, includeLast = FALSE)Arguments
from | A Date vector with interval start dates |
to | A Date vector with interval end dates |
includeFirst | A boolean indicating if the start date is included, defaultis ‘TRUE’ |
includeLast | A boolean indicating if the end date is included, defaultis ‘FALSE’ |
Details
This function takes two vectors of start and end dates and returns anothervector of the number of business days between each corresponding date pairaccording to the active calendar.
Value
A numeric vector with the number of business dates between thecorresponding date pair
Examples
businessDaysBetween(Sys.Date() + 0:6, Sys.Date() + 3 + 0:6)Thecalendars vector contains all calendar identifiers.
Description
Thecalendars vector contains all calendar identifiers.
Examples
head(calendars, 10)Compute end-of-month
Description
Compute a vector of dates with end-of-month
Usage
getEndOfMonth(dates)Arguments
dates | A Date vector with dates |
Details
This function takes a vector of dates and returns another vector of datesof the same length returning at each position whether the correspondingend-of-month date in the currently active (global) calendar.
Value
A Date vector with dates which are end-of-month
Examples
getEndOfMonth(Sys.Date()+0:6)Compute holidays or business days
Description
Compute the number of holidays (or business days) between two dates
Usage
getHolidays(from, to, includeWeekends = FALSE)getBusinessDays(from, to)Arguments
from | A Date object with the start date |
to | A Date object with the end date |
includeWeekends | A boolean indicating if weekends should be included, defaultis ‘FALSE’ |
Details
This function takes a start and end date and returns a vector of holidays(or business days) between them according to the active calendar.
Value
A Date vector with holidays or business days between the given dates
Examples
getHolidays(Sys.Date(), Sys.Date() + 30)Get calendar name, or id
Description
Get calendar name or id
Usage
getName()getId()Details
This function returns the corresponding (full) name (as in the underlyingimplementationclass) or identification string (used to select it) of thecurrent calendar.
Value
A string with the calendar name
Examples
getName()Test for business days
Description
Test a vector of dates for business day
Usage
isBusinessDay(dates)Arguments
dates | A Date vector with dates to be examined |
Details
This function takes a vector of dates and returns a logical vectorof the same length indicating at each position whether the correspondingdate is a business day in the currently active (global) calendar.
Value
A logical vector indicating which dates are business days
Examples
isBusinessDay(Sys.Date()+0:6)Test for end-of-month
Description
Test a vector of dates for end-of-month
Usage
isEndOfMonth(dates)Arguments
dates | A Date vector with dates to be examined |
Details
This function takes a vector of dates and returns a logical vectorof the same length indicating at each position whether the correspondingdate is at the end of a month in the currently active (global) calendar.
Value
A logical vector indicating which dates are end-of-month
Examples
isEndOfMonth(Sys.Date()+0:6)Test for holidays
Description
Test a vector of dates for holiday
Usage
isHoliday(dates)Arguments
dates | A Date vector with dates to be examined |
Details
This function takes a vector of dates and returns a logical vectorof the same length indicating at each position whether the correspondingdate is a holiday in the currently active (global) calendar.
Value
A logical vector indicating which dates are holidays
Examples
isHoliday(Sys.Date()+0:6)Test for weekends
Description
Test a vector of dates for weekends
Usage
isWeekend(dates)Arguments
dates | A Date vector with dates to be examined |
Details
This function takes a vector of dates and returns a logical vectorof the same length indicating at each position whether the correspondingdate is a weekend in the currently active (global) calendar.
Value
A logical vector indicating which dates are weekends
Examples
isWeekend(Sys.Date()+0:6)Set a calendar
Description
Set a calendar
Usage
setCalendar(calstr)Arguments
calstr | A character variable containing the market for which a calendaris to be set |
Details
This function sets a calendar to the given market or country convention.Note that at present only the default ‘TARGET’ and ‘UnitedStates’are supported.
Value
Nothing is returned but the global state is changed
Examples
setCalendar("UnitedStates")