Learn R Programming

telraamStats (version 1.1.2)

enrich_special_days: Enrich traffic data with french vacation and public holidays

Description

Enrich traffic data with french vacation and public holidays

Usage

enrich_special_days(data, vacations = NULL, public_holidays = NULL)

Value

Same dataframe with two additionnal columns :

  • holiday, boolean: TRUE if the day corresponds to public holiday, FALSE otherwise

  • vacation, indicating the french vacation, "No vacation" otherwise.

Arguments

data

Data frame containing a day and a date(day + hour + timezone) column

vacations

Data frame containing the vacation dates

public_holidays

Data frame containing the public holidays dates

Examples

Run this code
df <- data.frame('day' = as.Date(c("2022-02-18","2022-01-01")),
  'date' = c('2022-02-18 12:00:00 CET','2022-01-01 12:00:00 CET'))
enrich_special_days(df)

Run the code above in your browser using DataLab