Skip to contents

This function validates the submission dates in WCS surveys. It flags any submissions with dates earlier than January 1, 2020.

Usage

validate_dates(data = NULL)

Arguments

data

Data frame containing preprocessed survey data. If NULL, the function will return NULL.

Value

A data frame with the following columns:

submission_date

Date of survey submission. Dates before 2020-01-01 are set to NA.

alert_number

Numeric. 1 if the submission date is invalid (NA), NA otherwise.

survey_id

Integer. Unique identifier for each survey_id

Details

The function performs the following operations:

  1. Selects 'survey_id' and 'submission_date' columns from the input data.

  2. Sets submission dates before 2020-01-01 to NA.

  3. Creates an alert_number column: 1 for invalid dates, NA for valid dates.

Examples

if (FALSE) { # \dontrun{
validated_data <- validate_dates(survey_data)
} # }