View source: R/check_date_sequence.R
check_date_sequence | R Documentation |
Checks whether a date sequence in a vector of specified columns is in chronological order or not.
check_date_sequence(data, target_columns)
data |
The input |
target_columns |
A |
The input dataset. When found, the incorrect date sequences will be
stored in the report and can be accessed using
attr(data, "report")
.
# 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 the date sequence in two columns
good_date_sequence <- check_date_sequence(
data = data,
target_columns = c("date_first_pcr_positive_test", "date.of.admission")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.