The generic normalization that underpins functions like normal_city() and
normal_address(). This function simply chains together three
stringr::str_*() functions:
Convert to uppercase.
Replace punctuation with whitespaces.
Trim and squish excess whitespace.
str_normal(x, case = TRUE, punct = "", quote = TRUE, squish = TRUE)A character string to normalize.
logical; whether stringr::str_to_upper() should be called.
character; A character string to replace most punctuation with.
logical; whether stringr::str_replace_all() should be called
on double quotes.
logical; whether stringr::str_squish() should be called.
A normalized vector of the same length.
Other geographic normalization functions:
abbrev_full(),
abbrev_state(),
check_city(),
expand_abbrev(),
expand_state(),
fetch_city(),
normal_address(),
normal_city(),
normal_state(),
normal_zip()
str_normal(" TestING 123 example_test.String ")
#> [1] "TESTING 123 EXAMPLETESTSTRING"