standardize_string | R Documentation |
standardize_string
ensures that the input string (or character vector)
follows a consistent structure. It coerces the input to type
character
; converts characters to UTF-8
encoding; replaces
non-alphabetical symbols with a space; removes excess whitespace; and
converts to the desired case (title, by default). It also informs the user if
any characters could not be converted to UTF-8
.
standardize_string(string, case_fn = stringr::str_to_title, ...)
string |
The string or character vector to standardize |
case_fn |
A function for converting to the desired case. Note that
|
... |
Additional parameters to pass to |
This function is primarily intended to standardize proper nouns (such as names of persons) into a common format; it doesn't necessarily correct the strings. For more general string standardization of this type, see the snakecase package.
A character vector of the same length as string
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.