Convert numeric to date
Arguments
- data
The input data frame or linelist
- target_columns
A vector of columns names to be converted from numeric to date. When the input data is a
linelist
object, this parameter can be set tolinelist_tags
if you wish to only convert the tagged columns.- ref_date
A reference date. This can also be a character string with the name of the reference column.
- forward
A Boolean to indicate whether the counts started after the reference date (
TRUE
) or not (FALSE
). The default isTRUE
.
Examples
data <- readRDS(system.file("extdata", "test_df1.RDS", package = "cleanepi"))
data <- convert_numeric_to_date(
data = data,
target_columns = "recruted_on_day",
ref_date = as.Date("2022-10-13"),
forward = TRUE
)