Skip to contents

Is it a metropolitan-area name?

Usage

is_metro_area_name(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for a CBSA or CSA title (e.g. "New York-Newark-Jersey City, NY-NJ-PA"), matched case-insensitively against the .metro_area_names lookup. The lookup stores both the full title and a state-suffix-stripped variant, so "Corpus Christi, TX" and "Corpus Christi" both match.

Details

Exact-match on official Census titles; free-form metro names ("NYC metro") will miss. Distinct from is_city_name(), which won't match these hyphenated multi-city titles.

Examples

is_metro_area_name(c("Abilene-Sweetwater, TX", "Chicago", NA))
#> [1]  TRUE FALSE    NA