Description Usage Arguments Value Examples
View source: R/nth_weekday_of_a_month.R
Function to find the nth weekday in a certain month
1 | nth_weekday_of_a_month(dates, nth, weekday, month)
|
dates |
A vector with dates in the format YYYY-MM-DD |
nth |
int. The nth weekend you want to search for given a day and month |
weekday |
int. Sunday counts as 1, monday as 2, etc. |
month |
int. The month of interest (1 for January, 2 for February etc.) |
Date written in type character.
1 2 3 4 | dates <- seq_days(from = "2021-1-1", to = "2021-12-31")
# Suppose you want to find the date of mother's day
# Mother's day falls on the second sunday of may, thus:
nth_weekday_of_a_month(dates, nth = 2, weekday = 1, month = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.