View source: R/recur-on-position.R
recur_on_position | R Documentation |
recur_on_position()
let's you have fine tuned control over which element
of the set to select within the base frequency.
recur_on_position(x, n)
x |
A recurrence rule. |
n |
The positions to select within an intrafrequency set. Negative numbers select from the end of the set. |
An updated rrule.
library(lubridate, warn.conflicts = FALSE)
start <- "1999-01-01"
end <- "1999-05-01"
# You might want the last day of the month that is either a
# Sunday or a Monday, but you don't want to return both.
# This would return both:
on_last_monday_and_sunday <- monthly() %>%
recur_on_day_of_week(c("Monday", "Sunday"), nth = -1)
alma_search(start, end, on_last_monday_and_sunday)
# To return just the last one, you would select the last value in
# the set, which is computed on a per month basis
on_very_last_monday_or_sunday <- on_last_monday_and_sunday %>%
recur_on_position(-1)
alma_search(start, end, on_very_last_monday_or_sunday)
wday(alma_search(start, end, on_very_last_monday_or_sunday), label = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.