Skip to contents

Checks that for geographic levels with code and name column pairs, any location with a name of 'Not available' has the corresponding GSS not-available code 'x'. Levels without a code column (RSC region) and levels with their own combo lookups (National, Regional etc) are excluded. Rows at Institution and Planning area level are also excluded as they are ignored by EES.

Usage

check_geog_na_code(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

If no applicable geographic levels are present in the data, the check passes immediately.

Examples

check_geog_na_code(example_data)
#>          check result
#> 1 geog_na_code   PASS
#>                                                               message
#> 1 No applicable geographic levels to check for 'Not available' codes.
#>   guidance_url
#> 1           NA
check_geog_na_code(example_data, verbose = TRUE)
#>  No applicable geographic levels to check for 'Not available' codes.
#>          check result
#> 1 geog_na_code   PASS
#>                                                               message
#> 1 No applicable geographic levels to check for 'Not available' codes.
#>   guidance_url
#> 1           NA