| rset-add | R Documentation |
add_rschedule() is deprecated in favor of using the ... arguments of
runion(), rintersect(), and rsetdiff() directly.
add_rdates() is deprecated in favor of using runion() in combination
with a custom rcustom() rschedule holding the required dates.
add_exdates() is deprecated in favor of using rsetdiff() in combination
with a custom rcustom() rschedule holding the excluded dates.
add_rschedule(x, rschedule)
add_rdates(x, rdates)
add_exdates(x, exdates)
x |
An rset to add to. |
rschedule |
An rschedule, such as an rrule, runion, rintersect, or rsetdiff. |
rdates |
Dates to forcibly include in the rset. |
exdates |
Dates to forcibly exclude from the rset. |
An updated rset.
on_thanksgiving <- yearly() %>%
recur_on_day_of_week("Thurs", nth = 4) %>%
recur_on_month_of_year("Nov")
on_christmas <- yearly() %>%
recur_on_day_of_month(25) %>%
recur_on_month_of_year("Dec")
on_labor_day <- monthly() %>%
recur_on_month_of_year("Sep") %>%
recur_on_day_of_week("Mon", nth = 1)
# Rather than:
if (FALSE) {
rb <- runion() %>%
add_rschedule(on_thanksgiving) %>%
add_rschedule(on_christmas) %>%
add_rschedule(on_labor_day)
}
# Use the `...` of the `runion()` helper directly:
rb <- runion(on_thanksgiving, on_christmas, on_labor_day)
# Thanksgiving, Christmas, or Labor Day
alma_search("2019-01-01", "2021-01-01", rb)
# Except Labor Day in 2019
# Rather than:
if (FALSE) {
rb2 <- add_exdates(rb, "2019-09-02")
}
# We recommend:
rb2 <- rsetdiff(rb, rcustom("2019-09-02"))
alma_search("2019-01-01", "2021-01-01", rb2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.