
Check geographic level columns are completed
Source:R/check_geog_level_completed.R
check_geog_level_completed.RdFor each geographic level present in the data, checks that the associated
columns (code field, name field, and secondary code field where applicable)
contain no NA values. The new_la_code column is excluded from this check
as it can legitimately be blank for older Local authority records.
Rows at Planning area level are excluded as they are not used in the table
tool.
Details
Three cases result in a silent PASS, each intentionally caught by a dedicated check elsewhere in the screening pipeline:
Planning area rows: excluded here; flagged by
check_geog_ignored_rows().Invalid geographic levels (not present in
geography_df): skipped here; caught upstream byprecheck_geog_level().Missing geography columns (e.g.
region_codeabsent from the data entirely): silently skipped here; caught bycheck_geog_la_col_present()andcheck_geog_region_col_present().
See also
Other check_geog:
check_geog_country_combos(),
check_geog_eda_combos(),
check_geog_ignored_rows(),
check_geog_la_col_present(),
check_geog_la_combos(),
check_geog_lad_combos(),
check_geog_lep_combos(),
check_geog_lsip_combos(),
check_geog_na(),
check_geog_na_code(),
check_geog_other_code_dupes(),
check_geog_other_dupes(),
check_geog_overcompleted_cols(),
check_geog_pcon_combos(),
check_geog_region_col_present(),
check_geog_region_combos(),
check_geog_region_for_la(),
check_geog_region_for_lad(),
check_geog_ward_combos()
Examples
check_geog_level_completed(example_data)
#> check result
#> 1 geog_level_completed PASS
#> message guidance_url
#> 1 All geographic level columns are completed as expected. NA
check_geog_level_completed(example_data, verbose = TRUE)
#> ✔ All geographic level columns are completed as expected.
#> check result
#> 1 geog_level_completed PASS
#> message guidance_url
#> 1 All geographic level columns are completed as expected. NA