Learn R Programming

telraamStats (version 1.1.2)

is_vacation: 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)

Value

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

Arguments

date

Date (character format)

vacation

Dataframe of vacations, same format as set_globals_vars output.

Examples

Run this code
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)

Run the code above in your browser using DataLab