How to pad date by week ? In timetk
,below code want to pad time by week ,but it failed.
Anyone can help ? Thanks!
library(tidyverse)
library(timetk)
df <- data.frame(month_day=as.Date(c('2022-1-1','2022-2-1','2022-3-1')),
amount=c(100,400,600))
df %>% pad_by_time(month_day,
.by='week',
.fill_na_direction='down',
.start_date='2022',
.end_date = '2022-3-31')