powered by
cal_next() generates the next holiday after x.
cal_next()
x
cal_previous() generates the previous holiday before x.
cal_previous()
If no holiday exists before/after x, a missing row is generated.
cal_next(x, rcalendar, ..., inclusive = FALSE)cal_previous(x, rcalendar, ..., inclusive = FALSE)
cal_previous(x, rcalendar, ..., inclusive = FALSE)
A two column data frame, like cal_events(), which is the same size as x
cal_events()
and contains either the next or previous holiday relative to x.
[Date]
A vector of dates.
[rcalendar]
An rcalendar.
These dots are for future extensions and must be empty.
[logical(1)]
If x is an event, should it be considered the next or previous event?
x <- as.Date(c("2023-04-11", "2023-08-10", "2021-05-06")) cal <- cal_us_federal() cal_next(x, cal) cal_previous(x, cal)
Run the code above in your browser using DataLab