genHolidays: Generate public holidays for all markets

Description Usage Arguments Value Examples

View source: R/calendar.R

Description

The function heavily relies on the timeDate package in R for all holidays. Specifically it utilizes the listHolidays function to figure out which holidays are existing.

Usage

1
2
3
4
genHolidays(
  years = (lubridate::year(Sys.Date()) - 2):lubridate::year(Sys.Date()),
  country
)

Arguments

years

the years for which to generate the holidays given as 2013:2017 as an example where the default is the last three years

country

specifies which specific country to focus on except the "global" holidays where the possible values are "CA", "CH", "DE", "FR", "GB", "IT", "JP", "US"

Value

a one hot encoded tibble where each column is a holiday and the first column is the ISO date

Examples

1
2
b <- genHolidays(2016:2017)
b[1:10, 1:5]

DoktorMike/datools documentation built on Feb. 28, 2021, 8:39 a.m.