sch_add: Add an event to a schedule

Description Usage Arguments Examples

View source: R/sch-add.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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

sch_in("2019-01-01", sch)

sch_in("2019-12-25", sch)

DavisVaughan/almanac3 documentation built on Oct. 30, 2019, 5:59 a.m.