rbundle-add {almanac}R Documentation

Add to an rbundle

Description

Usage

add_rschedule(x, rschedule)

add_rdates(x, rdates)

add_exdates(x, exdates)

Arguments

x

[rbundle]

An rbundle to add to.

rschedule

[rschedule]

An rschedule, such as an rrule or rbundle.

rdates

[Date]

Dates to forcibly include in the rbundle.

exdates

[Date]

Dates to forcibly exclude from the rbundle.

Details

In terms of priority:

Value

An updated rbundle.

Examples

on_thanksgiving <- yearly() %>%
  recur_on_wday("Thurs", 4) %>%
  recur_on_ymonth("Nov")

on_christmas <- yearly() %>%
  recur_on_mday(25) %>%
  recur_on_ymonth("Dec")

on_labor_day <- monthly() %>%
  recur_on_ymonth("Sep") %>%
  recur_on_wday("Mon", 1)

rb <- runion() %>%
  add_rschedule(on_thanksgiving) %>%
  add_rschedule(on_christmas) %>%
  add_rschedule(on_labor_day)

# Thanksgiving, Christmas, or Labor Day
alma_search("2019-01-01", "2021-01-01", rb)

# Except Labor Day in 2019
rb2 <- add_exdates(rb, "2019-09-02")

alma_search("2019-01-01", "2021-01-01", rb2)


[Package almanac version 0.1.1 Index]