str_normal {campfin} | R Documentation |
Normalize a character string
Description
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.
Usage
str_normal(x, case = TRUE, punct = "", quote = TRUE, squish = TRUE)
Arguments
x |
A character string to normalize. |
case |
logical; whether |
punct |
character; A character string to replace most punctuation with. |
quote |
logical; whether |
squish |
logical; whether |
Value
A normalized vector of the same length.
See Also
Other geographic normalization functions:
abbrev_full()
,
abbrev_state()
,
check_city()
,
expand_abbrev()
,
expand_state()
,
fetch_city()
,
normal_address()
,
normal_city()
,
normal_state()
,
normal_zip()
Examples
str_normal(" TestING 123 example_test.String ")