Convert township name to its respective two-digit code and visa-versa.

town_convert(town)

Arguments

town

Vector of township names or numeric codes. Township name must be title case to match correctly.

Value

Vector or township codes or names equivalent to the input vector. Returns NA for towns that cannot be found.

Examples


town_convert("Evanston")
#> [1] "17"

town_convert(c("31", "25"))
#> [1] "Proviso"    "Northfield"

town_convert(c("31", "Proviso", "Lyons"))
#> [1] "Proviso" "31"      "21"