Learn R Programming

almanac (version 1.0.0)

rcustom: Create a custom rschedule

Description

rcustom() creates an rschedule from manually defined event dates. This can be useful when combined with runion() and rsetdiff() if you have a set of fixed event dates to forcibly include or exclude from an rschedule.

Usage

rcustom(events)

Value

A custom rschedule.

Arguments

events

[Date]

A vector of event dates.

Examples

Run this code
include <- rcustom("2019-07-05")
exclude <- rcustom("2019-07-04")

independence_day <- yearly() %>%
  recur_on_month_of_year("July") %>%
  recur_on_day_of_month(4)

# Remove forcibly excluded day
independence_day <- rsetdiff(independence_day, exclude)

# Add forcibly included day
independence_day <- runion(independence_day, include)

alma_search("2018-01-01", "2020-12-31", independence_day)

Run the code above in your browser using DataLab