Skip to contents

Scans each string for address components (street, PO box, city, state, ZIP) and returns TRUE when at least min_flags of them are present. A single component (just a ZIP, just a city) scores 1 and is better handled by the atomic detector; a full address scores 3-5.

Usage

is_address(x, min_flags = 3)

Arguments

x

A character vector.

min_flags

Minimum number of distinct components required (default 3).

Value

Logical vector; TRUE where >= min_flags components co-occur.

See also

Other address detectors: is_city_name(), is_city_state(), is_po_box(), is_state_zip(), is_street_address()

Examples

is_address(c("1225 S Walnut St, Bloomington, IN 47401", "Chicago", NA))
#> [1]  TRUE FALSE    NA