Checks that input data has required columns for the specified processing.
Value
If stop_on_error = TRUE, returns invisibly if valid or stops with error.
If stop_on_error = FALSE, returns a list with:
valid: Logical indicating if data passed all validationsissues: Named list of validation issues found (empty if none)n_rows: Number of rows in input datan_cols: Number of columns in input datajoin_keys_available: Character vector of available join key columns
Details
The function performs the following validations:
Checks for required columns for reference period identification:
Ano,Trimestre,UPA,V1008,V1014,V2008,V20081,V20082,V2009Validates year range (2012-2100 for PNADC coverage)
Validates quarter values (must be 1-4)
Validates birth day values (must be 1-31 or 99 for unknown)
Validates birth month values (must be 1-12 or 99 for unknown)
Warns about unusual ages (outside 0-130 range)
If
check_weights = TRUE, also validates weight-related columns:V1028,UF,posest,posest_sxi
See also
pnadc_identify_periods which calls this function
internally to validate input data.