fix_name | R Documentation |
Fix character variables by removing extraneous whitespace and possibly changing capitalization.
When using title case, words starting after an "-" are capitalized. A letter preceding an apostrophe (') is not capitalized. The words "and", "the" and "of" are not capitalized. Single letters alternated with dots (abbreviations) are capitalized.
Alternatively, you can get title case with tools::toTitleCase(fix_name(x, "lower"))
fix_name(x, case="", skip="", lowothers=TRUE)
x |
character |
case |
character. If this is not |
skip |
character. Additional words to skip when case="title" (see details) |
lowothers |
logical. Only relevant when case is "first" or "title". Should all other characters be made lowercase? |
character
d <- c("aruba", "BOM BINI", "saint-vincent and the grenadines",
"the u.s. of america", "côte d'ivoire")
fix_name(d, "title")
fix_name(d, "title", skip="bini")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.