diff --git a/R/create.R b/R/create.R index f458095bf..be09971f2 100644 --- a/R/create.R +++ b/R/create.R @@ -38,10 +38,7 @@ create_clean_reported_cases <- function(reported_cases, horizon, reported_cases <- data.table::setorder(reported_cases, date) ## Filter out 0 reported cases from the beginning of the data if (filter_leading_zeros) { - reported_cases <- reported_cases[order(date)][ - , - cum_cases := cumsum(confirm, na.rm = TRUE) - ][min(date[cum_cases > 0])][, cum_cases := NULL] + reported_cases <- reported_cases[order(date)][min(date[confirm > 0])] } # Check case counts preceding zero case counts and set to 7 day average if