Often, a single rrule will be sufficient. However, more complex recurrence objects can be constructed by combining multiple rschedules into a recurrence set.
There are three types of recurrence sets provided in almanac, each of which construct their event sets by performing a set operation on the underlying events of the rschedules in the set.
runion() takes the union.
rintersect() takes the intersection.
rsetdiff() takes the set difference.
runion(...)rintersect(...)rsetdiff(...)
Arguments
...: [rschedules]
rschedule objects to add to the set.
Returns
A runion, rintersect, or rsetdiff.
Details
For rsetdiff(), the event set is created "from left to right" and depends on the order that the rschedules were added to the set.
Examples
since <-"2019-04-01"until <-"2019-05-31"on_weekends <- weekly(since = since, until = until)%>% recur_on_weekends()on_25th <- monthly(since = since, until = until)%>% recur_on_day_of_month(25)# On weekends OR the 25th of the monthru <- runion(on_weekends, on_25th)alma_events(ru)# On weekends AND the 25th of the monthri <- rintersect(on_weekends, on_25th)alma_events(ri)# On weekends AND NOT the 25th of the monthrsd1 <- rsetdiff(on_weekends, on_25th)alma_events(rsd1)# On the 25th of the month AND NOT the weekendrsd2 <- rsetdiff(on_25th, on_weekends)alma_events(rsd2)