df <- data.frame(
dates = sample(seq(Sys.Date() - 365, Sys.Date(), by = 1), 50),
times = sample(seq(Sys.time() - 1e7, Sys.time(), by = 1), 50)
)
# Input as a vector or dataframe
date_feats(df, drop = TRUE) %>% head(10)
# Holidays given a date range and country
if (FALSE) {
hol <- date_feats(
seq(Sys.Date() - 365, Sys.Date(), by = 1),
holidays = TRUE,
country = "Venezuela"
)
head(hol[!is.na(hol$holiday_name), ])
}
Run the code above in your browser using DataLab