on_date: Specify the date(s) of a schedule

View source: R/date.R

on_dateR Documentation

Specify the date(s) of a schedule

Description

Creates a schedule of events occurring on the dates specified.

This function is best used when making ad-hoc changes to other schedules.

Usage

on_date(...)

Arguments

...

A vector of dates.

Value

A schedule object.

Examples

my_dates <- seq.Date(as.Date("2000-01-01"),
                     as.Date("2000-01-05"),
                     "1 day")

on_first_day_millennium <- on_date(as.Date("2000-01-01"))
on_first_or_second_day_millennium <- on_date(as.Date("2000-01-01"),
                                             as.Date("2000-01-02"))

happen(on_first_day_millennium, my_dates)
happen(on_first_or_second_day_millennium, my_dates)

on_regular_paydays <- on_mday(25)
on_bonus_payday <- on_date(as.Date("2000-12-20"))

on_paydays <- also_occur(on_bonus_payday, on_regular_paydays)

schedule_days(on_paydays, during = 2000)

jameslairdsmith/gs documentation built on July 19, 2023, 12:49 a.m.