Determine the presence of unit types within a string.
pm_has_unit(.data, dictionary, scalar = TRUE, locale = "us")
.data | A postmastr object (created with |
---|---|
dictionary | Optional; a tbl created with |
scalar | If |
locale | A string indicating the country these data represent; the only current option is "us" but this is included to facilitate future expansion. |
A tibble with a new logical variable pm.hasUnit
that is
TRUE
if a state name or abbreviation is found in the address
and FALSE
otherwise.
If scalar = TRUE
, a single logical scalar is returned that is
TRUE
if the data contain statenames or abbreviations and FALSE
if they do not. If scalar = FALSE
a tibble with a new logical variable
pm.hasUnit
that is TRUE
if a unit types is found in the address
and FALSE
otherwise.