
Assert the HOOD_* schema version of a TPS data.frame
Source:R/toronto_neighbourhoods.R
morie_tps_assert_hood_version.RdErrors when the expected schema's column is absent. Warns when BOTH schemas are present (downstream code MAY accidentally use the wrong one).
Usage
morie_tps_assert_hood_version(df, expected = c("158", "140"))Examples
cw <- morie_to_hood_crosswalk()
df <- data.frame(HOOD_158 = utils::head(cw$HOOD_158, 5))
res <- try(morie_tps_assert_hood_version(df, expected = "158"))
#> Error : expected HOOD_158 schema but no HOOD_158 / hood_158 / NEIGHBOURHOOD_158 / neighbourhood_158 column found in df