on_nth | R Documentation |
Given a schedule of events, create a new schedule of only the nth occurrences within a given period.
on_nth(n, x, within_given)
on_first(x, within_given)
on_second(x, within_given)
on_third(x, within_given)
on_fourth(x, within_given)
on_last(x, within_given)
n |
A single integer specifying which event to select. A negative
integer will select the nth last event (i.e. |
x |
A schedule from which to select events. |
within_given |
A period from within which to select events. Can be either:
|
Convenience functions are provided for the first, second, third, fourth and last events of a given period.
All functions accept arbitrarily complex schedules. For example, if you
wanted a schedule of events occurring on the 12th either Tuesday or Thursday
of the quarter you would use:
on_nth(12, on_wday("Tue", "Thu"), within_given = "quarter")
.
A schedule object.
tuesday <- on_wday("Tue")
second_tuesday_month <- on_second(tuesday, within_given = "month")
schedule_days(second_tuesday_month, during = 2000)
last_tuesday_year <- on_last(tuesday, within_given = "year")
schedule_days(last_tuesday_year, during = 2000)
tenth_tuesday_quarter <- on_nth(10, tuesday, within_given = "quarter")
schedule_days(tenth_tuesday_quarter, during = 2000)
tues_or_thurs <- on_wday("Tue", "Thu")
tenth_tues_or_thurs_quarter <- on_nth(10, tues_or_thurs, within_given = "quarter")
schedule_days(tenth_tues_or_thurs_quarter, during = 2000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.