Skip to contents

To Proper

Usage

toproper(
  string,
  replace_underscores = TRUE,
  underscore_replacement = " ",
  return_as = c("titlecase", "uppercase", "lowercase", "asis"),
  uppers = c("Tpa")
)

Arguments

string

string to manipulate on

replace_underscores

Logical: if TRUE replaces all underscores with specified underscore_replacement argument's value.

underscore_replacement

Character: if argument replace_underscores equals TRUE, will replace all "_"'s with specified string.

return_as

How should the string be returned? Options are:

  • "titlecase": Applies stringr::str_to_title.

  • "uppercase": Applies toupper.

  • "lowercase": Applied tolower.

  • "asis": No manipulation. Returns as is.

uppers

Abbreviations to keep upper-case.

Value

"Proper" string

See also

Examples

s <- "variable_a is awesome"
toproper(s)
#> [1] "Variable A Is Awesome"