sch_add()
allows you to add an event
to a schedule, optionally providing
a name
for the event.
sch_add(x, event, name = NULL)
x |
A schedule. |
---|---|
event |
An event. |
name |
A name for the event. If left as |
# 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#> [1] FALSE#> [1] TRUE