knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
cat( badger::badge_devel("Glender/DutchDayDummies", "purple"), badger::badge_codefactor("rossellhayes/ipa"), badger::badge_lifecycle("maturing", "blue"), badger::badge_github_actions("rossellhayes/ipa"), badger::badge_codecov("rcannood/princurve"), badger::badge_code_size("Glender/DutchDayDummies") )
The goal of the DutchDayDummies package is to provide functions that can quickly generate regression dummies for official and non-official dutch holidays. It includes virtually all existing (non-official) dutch holidays, varying from Christmas, Easter and Ramadan to Mother's day, Black Friday and Summer vacation. The functions that create the holiday dummies use algorithms to convert dates to dummies and thus don't require any input besides the to-be-converted date.
# Install the cutting edge development version from GitHub: # install.packages("devtools") devtools::install_github("Glender/DutchDayDummies")
Start by creating daily dates that conform to our required format and then run a function like xmas_day
:
library(DutchDayDummies) # create sequence of dates dates <- seq_days(from="2021-12-24", to="2021-12-27") # print both results dates xmas_day(dates)
We can gather results of multiple holidays with a tibble dataframe:
library(tibble) tibble( dates = seq_days(from="2021-12-24", to="2022-1-2"), xmas = xmas_day(dates), boxing = boxing_day(dates), nyd = newyears_day(dates), nye = newyears_eve(dates) )
The DutchDayDummies package provides four categories of important functions: official holiday dummies, non-official holidays dummies, vacation dummies, and helper functions.
newyears_day()
easter_sunday()
easter_monday()
kings_day()
ascension_thursday()
white_monday()
white_sunday()
xmas_day()
boxing_day()
carnival_sunday()
valentines_day()
good_friday()
ramadan()
kings_day()
remembrance_day()
liberation_day()
mothers_day()
sugar_feast()
fathers_day()
sacrificial_feast()
prinsjesdag()
world_animal_day()
thanksgiving_day()
halloween()
st_martins_day()
black_friday()
cyber_monday()
st_nicholas_day()
newyears_eve()
autumn_vacation()
xmas_vacation()
spring_vacation()
may_vacation()
summer_vacation()
xmas_and_boxing_day()
pentecost_days()
easter_weekend()
seq_days(from, to)
to create a vector of daily dates of class date.create_dummies(dates, holiday_dates)
to generate dummies for a given holiday that is not included in the package.nth_weekday_of_a_month(dates, nth, weekday, month)
to find the nth weekday in a certain month.get_wday_before_dates()
tells you the dates of a weekday before a specified date.ummalqura_algorithm(date)
converts gregorian dates to Islamic dates. gauss_easter_algorithm(year)
tells you when easter falls on a given year.The documentation of all functions can be accessed by ?<function-name>
or navigate via the package documentation help page ?DutchDayDummies
.
# For example: ?ummalqura_algorithm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.