R/schedule.R
, R/schedule_by_cycle.R
, R/schedule_by_day.R
schedule.Rd
schedule()
defines work schedules based off of a given cycle
. If this
cycle is named, it is assumed that the names are days of the week, and that
the schedule repeats weekly. If it is unnamed, the cycle
begins at the
anchor
date. Defining rotating weekly schedules
(i.e. T/R one week, M/W/F the next) is not currently supported using weekday
names; these schedules may be defined as a rotating schedule anchored to the
beginning of a week.
schedule( cycle = c(Sun = FALSE, Mon = TRUE, Tue = TRUE, Wed = TRUE, Thu = TRUE, Fri = TRUE, Sat = FALSE), start = Sys.Date(), end = Sys.Date() + 29L, anchor = start ) schedule_by_cycle( cycle = c(FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE), start = Sys.Date(), end = Sys.Date() + 29L, anchor = start ) schedule_by_day( cycle = c(Sun = FALSE, Mon = TRUE, Tue = TRUE, Wed = TRUE, Thu = TRUE, Fri = TRUE, Sat = FALSE), start = Sys.Date(), end = Sys.Date() + 29L )
cycle | A logical vector defining one scheduling cycle. If named, names
are passed to
|
---|---|
start | The start date of the returned schedule; either a string in
"YYYY-MM-DD" format or a |
end | The end date of the returned schedule; either a string in
"YYYY-MM-DD" format or a |
anchor | The date from which to start ("anchor") schedule calculations.
This can be any valid date; no particular relationship to |
A tibble
with columns date
(a Date
column containing dates
between start
and end
, inclusive), weekday
(a character
column
containing full weekday names), and scheduled
(a logical
column
defining whether a day is schedule ("on") or not ("off"))
schedule_by_cycle()
and schedule_by_day()
are the workhorses
underlying as_schedule()
. They handle the general cyclic and weekly use
cases described above.
Other Case Assignment:
sched_add_nights_weekends()
,
sched_calc()
,
sched_join_schedules()
,
sched_load_nights_weekends()
,
sched_load_teams()
,
sched_parse_nights_weekends()
,
sched_std_names()
,
schedule_predefined()