# import the data
data <- readRDS(system.file("extdata", "test_df.RDS", package = "cleanepi"))
# standardize the date values
data <- data %>%
standardize_dates(
target_columns = c("date_first_pcr_positive_test", "date.of.admission"),
error_tolerance = 0.4,
format = NULL,
timeframe = NULL
)
# check whether all admission dates come after the test dates
good_date_sequence <- check_date_sequence(
data = data,
target_columns = c("date_first_pcr_positive_test", "date.of.admission")
)
# display rows where admission dates do not come after the test dates
print_report(
data = good_date_sequence,
what = "incorrect_date_sequence"
)
Run the code above in your browser using DataLab