Skip to contents

Catch if any geography columns are being included as filters in the metadata file. This checks both filter col_name values and filter_grouping_column values against a regex pattern that matches common geography-related column names (e.g., names containing "la", "region", "urn", "ukprn", etc.).

Usage

check_meta_geog_catch(meta, verbose = FALSE, stop_on_error = FALSE)

Arguments

meta

A data frame of the metadata 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 the only filter is school_name or provider_name, those are excluded from the check as they are acceptable as filters in that context.

Examples

check_meta_geog_catch(example_meta)
#>             check result                                                message
#> 1 meta_geog_catch   PASS No filters appear to be mislabelled geography columns.
#>   guidance_url
#> 1           NA
check_meta_geog_catch(example_meta, verbose = TRUE)
#>  No filters appear to be mislabelled geography columns.
#>             check result                                                message
#> 1 meta_geog_catch   PASS No filters appear to be mislabelled geography columns.
#>   guidance_url
#> 1           NA