View source: R/generate_dates.R
generate_dates | R Documentation |
This function generates a sequence of dates based on the specified start and end dates, and filters the dates to include only the selected days of the week.
generate_dates(start_date, end_date, days_of_week, locale = "us")
start_date |
The start date of the date sequence in "YYYY-MM-DD" format. |
end_date |
The end date of the date sequence in "YYYY-MM-DD" format. |
days_of_week |
A string specifying the days of the week to include in the date sequence. Each character represents a day of the week (e.g., "m" for Monday, "t" for Tuesday). |
locale |
The locale to use for determining the day names. Default is "us" (United States). If set to "es" (Spanish), the dates will take European format (DD-MM-YYYY) and the day names will be translated to Spanish. |
A data frame with two columns: 'date' (formatted dates) and 'day' (day names).
## Not run:
generate_dates("2024-01-17", "2024-05-01", "wf", locale = "es")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.