apply_zero_threshold {EpiNow2} | R Documentation |
Convert zero case counts to NA
(missing) if the 7-day average is above a
threshold.
Description
This function aims to detect spurious zeroes by comparing the 7-day average
of the case counts to a threshold. If the 7-day average is above the
threshold, the zero case count is replaced with NA
.
Usage
apply_zero_threshold(data, threshold = Inf, obs_column = "confirm")
Arguments
data |
A |
threshold |
Numeric, defaults to |
obs_column |
Character (default: "confirm"). If given, only the column specified here will be used for checking missingness. This is useful if using a data set that has multiple columns of hwich one of them corresponds to observations that are to be processed here. |
Value
A data.table with the zero threshold applied.