if (FALSE) {
shift <- 7
horizon <- 7
smoothing_window <- 14
## add NAs for horizon
cases <- add_horizon(example_confirmed[1:30], horizon)
## add zeroes initially
cases <- data.table::rbindlist(list(
data.table::data.table(
date = seq(
min(cases$date) - 10,
min(cases$date) - 1,
by = "days"
),
confirm = 0, breakpoint = 0
),
cases
))
create_shifted_cases(cases, shift, smoothing_window, horizon)
}
Run the code above in your browser using DataLab