Description Usage Arguments Details Value
Extract various info from a DateTime value such as day of the week, time of day, day of the year, whether the time and day is during working hours, if it is a holiday or national vacation day, etc.
1 2 | datetime_to_cols(datetime, country = "denmark", suffixes = NULL,
return = "data.table", verbose = FALSE)
|
datetime |
A datetime object. |
country |
What country to get country specific values (holidays, vacations and time of day) from. See details for a list of countries. |
suffixes |
A character specifying the suffixes to be used for all columns.This is particularly handy if you want to keep track of multiple datetime inputs. NULL == no suffixes. |
return |
character; What class to return the output data in - either 'data.table', 'data.frame' or 'tibble'. |
verbose |
Show what is going on... |
The following countries are supported:
denmark
A Data Frame including the following columns (class in parenthesis):
datetime: The inputtet datetime parameter (same class as your input)
date: Date (IDate or Date)
time: Time (ITime)
year: Year (integer)
quarter: Quarter of the year (integer)
month: Month of the year (integer)
week: Week number (integer)
yday: Day of the year (integer)
mday: Day of the month (integer)
wday: Day of the week - 1 is monday (integer)
hour: Hour (integer)
minute: Minute (integer)
second: Second (integer)
timeOfDay: The time of day (factor)
withinWorkingHours: Is it within working hours (logical)
firstWeekMonth: Is it the first week of the month (logical)
lastWeekMonth: Is it the last week of the month (logical)
firstMondayMonth: Is it the first monday of the month (logical)
lastFridayMonth: Is it the last friday of the month (logical)
isHoliday: Is it a national holiday (logical)
isVacation: Is it a national vacation (logical)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.