Skip to contents

Is it a US city / place name?

Usage

is_city_name(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for a name in the normalized .us_cities lookup (case/punctuation-insensitive). Coverage is the ~1,000 larger US cities (maps::us.cities); smaller towns will miss.

Examples

is_city_name(c("Chicago", "New Orleans", "Nowheresville", NA))
#> [1]  TRUE  TRUE FALSE    NA