Attempt to convert words from given format to sentence, title, lower, or upper case while being mindful of APA style guidelines, acronyms, and custom word replacement lists.
fix_case(
x,
to_lower_first = FALSE,
replace_underscores = TRUE,
underscore_replacement = " ",
to_lower_minor_words = TRUE,
minor_words = curios::minor_words,
to_upper_known_acronyms = TRUE,
known_acronyms = curios::known_acronyms,
replace_named_words = FALSE,
named_words = NA,
case = c("title", "sentence", "lower", "upper")
)
character string.
logical,indicating character string should first be converted to all lower case.
logical determines replacement of underscore characters.
character string to replace underscores.
logical determines if minor words are all lower case.
named character vector of minor words that will be converted to lower case.
logical determines if known acronyms are replaced with case correct versions.
named character vector of acronyms that will be converted to proper case.
logical determines if a set of named_words
are replaced with case correct versions.
named character vector of words that will be replaced with alternate words or word case
character designating the overall case structure: title (default), sentence, lower, upper.
character string
Note: word replacement is done in a case sensitive manner. For example, "usDA" would be replaced with "USDA" as would "UsDA" or "usda".
fix_case("the hba1c level was reported as a1C", case = "sentence")
#> [1] "The HbA1c level was reported as A1c"