business-science / timetk

Time series analysis in the `tidyverse`
https://business-science.github.io/timetk/
603 stars 99 forks source link

holiday indicator, day after /before holiday indicator functionality #160

Open alejandrohagan opened 7 months ago

alejandrohagan commented 7 months ago

Hi Matt

Great package -- honestly the package for time series of modeling out of any language. Thank you.

I noticed in the python port that the equivalent timetk::tk_augment_holiday_signature() will return the not just a holiday indicator but also the day before and day after holiday indicator.

Can this functionality be brought to the R package?

Also I've noticed it will flag the day of the holiday however if the holiday falls on a sat/sun usually the weekday after that is a public holiday -- however there is no way to flag that. Is it possible to flag not just the holiday but the public holiday it will trigger?

joranE commented 7 months ago

I have accomplished this sort of effect using the extrasteps package, e.g. the steps step_time_event(), step_date_before(), step_date_after(), etc. Those recipe steps lean heavily on the almanac package so be sure to familiarize yourself with almanac, as the documentation in the extrasteps package is a little sparse, as the steps there are still slightly experimental.