This function checks the validity of the landing_date
in the provided dataset by comparing
it to the submission_date
. If the landing_date
is after the submission_date
, an alert
is triggered and the landing_date
is set to NA for those records.
Usage
validate_dates(data = NULL)
Arguments
- data
A data frame containing the landing_date
and submission_date
columns.
Value
A data frame with three columns:
survey_id
: The unique identifier for each survey
landing_date
: The original date if valid, otherwise NA
alert_date
: A numeric value (1) indicating an invalid date, or NA if the date is valid