Validate a CSV data frame against the ANA metric map
validate_csv.RdChecks header structure, UOA uniqueness, and per-cell type constraints.
Returns an ana_validation_result object with full error detail.
Usage
validate_csv(df, metric_map, opts = list())Arguments
- df
A
data.frame(or tibble) with one row per unit of analysis. All values are expected to be character strings orNA(as produced byreadr::read_csv()withcol_types = cols(.default = "c")), but numeric columns are also accepted and coerced to character for checking.- metric_map
A named list keyed by metric ID (e.g.
"MET001"). Each value must be a list with at least atypeelement (the type string used for cell-level validation).- opts
A list of options:
require_non_empty(logical, defaultFALSE): ifTRUE, empty cells are treated as errors rather than missing values.