View source: R/expand-abbrev.R
expand_abbrev | R Documentation |
Create or use a named vector (c("abb" = "rep")
) and pass it to
stringr::str_replace_all()
. The abb
argument is surrounded with \\b
to capture only isolated abbreviations. To be used inside
normal_address()
and normal_city()
with usps_street and usps_city,
respectively.
expand_abbrev(x, abb = NULL, rep = NULL)
x |
A vector containing abbreviations. |
abb |
One of three objects: (1) A dataframe with abbreviations in the
first column and corresponding replacement strings in the second
column; (2) a named vector, with abbreviations as names for their
respective replacements (e.g., |
rep |
If |
The vector x
with abbreviation replaced with their full version.
Other geographic normalization functions:
abbrev_full()
,
abbrev_state()
,
check_city()
,
expand_state()
,
fetch_city()
,
normal_address()
,
normal_city()
,
normal_state()
,
normal_zip()
,
str_normal()
expand_abbrev(x = "MT VERNON", abb = c("MT" = "MOUNT"))
expand_abbrev(x = "VT", abb = state.abb, rep = state.name)
expand_abbrev(x = "Low FE Level", abb = tibble::tibble(x = "FE", y = "Iron"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.