recur_on_interval: Recur on an interval

View source: R/recur-on-interval.R

recur_on_intervalR Documentation

Recur on an interval

Description

recur_on_interval() adjusts the interval of the base frequency of the recurrence rule. For example, a monthly() rule with an interval of 2 would become "every other month".

Usage

recur_on_interval(x, n)

Arguments

x

⁠[rrule]⁠

A recurrence rule.

n

⁠[positive integer(1)]⁠

The interval on which to recur.

Value

An updated rrule.

Examples

# The default interval is 1
on_monthly <- monthly(since = "1999-01-01")

alma_search("1999-01-01", "1999-06-01", on_monthly)

# Adjust to every other month
on_every_other_month <- on_monthly %>% recur_on_interval(2)

alma_search("1999-01-01", "1999-06-01", on_every_other_month)

# Note that the frequency is limited to "every other month", but you
# can still have multiple events inside a single month
on_every_other_month_on_day_25_or_26 <- on_every_other_month %>%
  recur_on_day_of_month(25:26)

alma_search("1999-01-01", "1999-06-01", on_every_other_month_on_day_25_or_26)


almanac documentation built on April 14, 2023, 12:23 a.m.