Description Usage Arguments Value Examples
View source: R/create_dummies.R
Create a dummy variable that takes the value 0 or 1 to indicate the abscence or presence of a holiday. The day(s) before or after the holiday dates can also be recoded by using the pre and post arguments. For example, if you also want to recode the two days after your specified holiday dates, set post argument to 2.
1 | create_dummy(dates, holiday_dates, pre = 0, post = 0)
|
dates |
date |
holiday_dates |
date |
pre |
non-negative int. To recode the x days after the holiday dates. |
post |
non-negative int. To recode the x days before the holiday dates. |
A dummy (binary vector)
1 2 | dates <- seq_days(from = "2021-12-24", to = "2021-12-31")
create_dummy(dates, as.Date("2021-12-25"), post = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.