# convert strings to sentence case stringr::str_to_sentence(c("aaa", "BBB")) # -> "Aaa", "Bbb" # rename multiple values patterns <- list( "old1" = "new1", "old2" = "new2" ) stringi::stri_replace_all_regex( c("old1 value", "old2 value"), pattern = names(patterns), replacement = unlist(patterns), vectorize_all = FALSE ) # -> "new1 value" "new2 value"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter