Skip to contents

Checks that all country_code and country_name combinations in the data file are valid. Rows where country_code is "x" (the GSS not-available code) are excluded. All other combinations, including any with blank or NA codes, are checked against the standard geographies lookup and will fail if not found.

Usage

check_geog_country_combos(data, verbose = FALSE, stop_on_error = FALSE)

Arguments

data

A data frame of the data file

verbose

logical, if TRUE prints feedback messages to console for every test, if FALSE run silently

stop_on_error

logical, if TRUE will stop with an error if the result is "FAIL", and will throw genuine warning if result is "WARNING"

Value

a single row data frame

Details

No geographic_level distinction is made. This matches the legacy country_combinations() behaviour in dfe-published-data-qa, which filtered out "x" uniformly across all rows. Country columns are mandatory in the data standard, so blank or NA values at any geographic level are genuine errors.

Examples

check_geog_country_combos(example_data)
#>                 check result
#> 1 geog_country_combos   PASS
#>                                                   message guidance_url
#> 1 All country_code / country_name combinations are valid.           NA
check_geog_country_combos(example_data, verbose = TRUE)
#>  All country_code / country_name combinations are valid.
#>                 check result
#> 1 geog_country_combos   PASS
#>                                                   message guidance_url
#> 1 All country_code / country_name combinations are valid.           NA