is_vacation: Indicates if a date is in vacation period and if true, which...

View source: R/utils_global.R

is_vacationR Documentation

Indicates if a date is in vacation period and if true, which vacation.

Description

If the date is not in a vacation period, "No vacation" is returned.

Usage

is_vacation(date, vacation)

Arguments

date

Date (character format)

vacation

Dataframe of vacations, same format as set_globals_vars output.

Value

Vacation description if the day is between two dates, "No vacation" otherwise.

Examples

vacation <- data.frame('description' = c('Vacances de Noël'),
  start_date = as.POSIXct('2021-12-17 23:00:00'),
  end_date = as.POSIXct('2022-01-02 23:00:00'))
is_vacation(as.Date('2022-01-01'), vacation)

telraamStats documentation built on May 29, 2024, 10:08 a.m.