Does a date fall on a schedule?
happen(schedule, date)
schedule | A schedule object |
---|---|
date | a date-time object |
TRUE or FALSE depending on whether the date falls on the schedule.
my_dates <- seq.Date(from = as.Date("2000-01-01"), to = as.Date("2000-01-10"), by = "1 day") on_saturday <- on_wday("Sat") on_sunday <- on_wday("Sun") happen(on_saturday, my_dates)#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSEhappen(on_sunday, my_dates)#> [1] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE#> [1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE