Skip to contents

Errors 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"))

Arguments

df

A TPS crime data.frame.

expected

Either "158" or "140".

Value

Invisibly TRUE on success.

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