is_vacation {telraamStats} | R 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)
[Package telraamStats version 1.1.2 Index]