holiday_data | R Documentation |
Builds a dataframe of holiday dates between 2 dates in the form of 'yyyy-mm-dd'. Pass a dataframe with the column of dates.
holiday_data(df, out_df = c("weeks", "days"))
df |
|
out_df |
|
The result of the function can be either a dataframe with days between the minimum and maximum of the dates provided, or, the default option which is to return a dataframe with weeks instead of days.
The paramater out_df
gives the user 2 choices for output. The
default output a weeks dataframe with beginning week, ending week, a holiday
flag, and a column for the holiday name. The second option returns a
dataframe with all the days and day names with the 4 columns mention above.
https://github.com/cran/timeDate/blob/master/R/holiday-Dates.R
https://www.federalpay.org/holidays
## Not run:
# Holiday dates in a dataframe
library(holiday.dates)
weeks_df <- tibble::tibble(weeks = seq.Date(as.Date('2015-01-01'),
as.Date('2020-01-01'), by = 'week'))
holiday_data(df = weeks_df) %>% head(10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.