filter_leading_zeros: Filter leading zeros from a data set.
Description
Filter leading zeros from a data set.
Usage
filter_leading_zeros(data, obs_column = "confirm", by = NULL)
Value
A data.table with leading zeros removed.
Arguments
data
A <data.frame> of disease reports (confirm) by date (date).
confirm must be numeric and date must be in date format. Optionally
this can also have a logical accumulate column which indicates whether
data should be added to the next data point. This is useful when modelling
e.g. weekly incidence data. See also the fill_missing() function which
helps add the accumulate column with the desired properties when dealing
with non-daily data. If any accumulation is done this happens after
truncation as specified by the truncation argument.
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.
by
Character vector. Name(s) of any additional column(s) where
data processing should be done separately for each value in the column.
This is useful when using data representing e.g. multiple geographies. If
NULL (default) no such grouping is done.