knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of holiday.dates is to create a data frame with holiday dates flagged in a dataframe. The user has options for the output data frame to be either the days or weeks between 2 days. A column of dates can also be passed to the function, but it will only use the first and last dates to build the holiday data frame.
You can install the development version of holiday.dates like so:
library(remotes) remotes::install_github("Fredo-XVII/holiday.dates")
Below you will an example for holidays associated with days. Notice that in this output you get the calendar date as well as the week begin date and the week end date.
library(holiday.dates) days_df <- tibble::tibble(weeks = seq.Date(as.Date('2015-01-01'), as.Date('2025-01-01'), by = 'day')) holiday_data(df = days_df, out_df = "days") %>% head(10)
In this example you will see that output for when the out_df = "week"
. It is
the aggregation of the days dataframe up to the week level. You can see how the
first row relates to the first 7 rows in the data frame above.
library(holiday.dates) weeks_df <- tibble::tibble(weeks = seq.Date(as.Date('2015-01-01'), as.Date('2025-01-01'), by = 'week')) holiday_data(df = weeks_df, out_df = "week") %>% head(10)
NOTE: For those days/weels when there is no holiday the value for holiday name field is NoHoliday
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.