sch_add() allows you to add an event to a schedule, optionally providing a name for the event.

sch_add(x, event, name = NULL)

Arguments

x

[schedule]

A schedule.

event

[event]

An event.

name

[character(1) / NULL]

A name for the event. If left as NULL, a default name will be created.

Examples

# Labor Day = First Monday in September on_labor_day <- on_month("Sep") & on_wday("Mon") & on_mweek(1) # Christmas = December 25th on_christmas <- on_month("Dec") & on_mday(25) sch <- schedule() sch <- sch_add(sch, on_labor_day, "Labor Day") sch <- sch_add(sch, on_christmas, "Christmas") sch
#> <Schedule [2 event(s)]> #> - Labor Day #> - Christmas
sch_in("2019-01-01", sch)
#> [1] FALSE
sch_in("2019-12-25", sch)
#> [1] TRUE