filter_leading_zeros | R Documentation |
Filter leading zeros from a data set.
filter_leading_zeros(data, obs_column = "confirm", by = NULL)
data |
A |
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. |
A data.table with leading zeros removed.
cases <- data.frame(
date = as.Date("2020-01-01") + 0:10,
confirm = c(0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
)
filter_leading_zeros(cases)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.