Filters leading zeros, completes dates, and applies an optional threshold at
which point 0 cases are replaced with a user supplied value (defaults to
NA).
Usage
create_clean_reported_cases(
data,
filter_leading_zeros = TRUE,
zero_threshold = Inf,
fill = NA_integer_,
add_breakpoints = TRUE
)Arguments
- data
A
<data.frame>of disease reports (confirm) by date (date).confirmmust be numeric anddatemust be in date format. Optionally this can also have a logicalaccumulatecolumn which indicates whether data should be added to the next data point. This is useful when modelling e.g. weekly incidence data. See also thefill_missing()function which helps add theaccumulatecolumn with the desired properties when dealing with non-daily data. If any accumulation is done this happens after truncation as specified by thetruncationargument.- filter_leading_zeros
Logical, defaults to TRUE. Should zeros at the start of the time series be filtered out.
- zero_threshold
Numeric defaults to Inf. Indicates if detected zero cases are meaningful by using a threshold number of cases based on the 7-day average. If the average is above this threshold then the zero is replaced using
fill.- fill
Deprecated; zero dates with 7-day averages above the
zero_thresholdwill be skipped in model fitting.- add_breakpoints
Logical, defaults to TRUE. Should a breakpoint column be added to the data frame if it does not exist.