x <- c("Hello world!", "this is a TEST sentence.", "the end.")
capitalize(x)
capitalize(tolower(x))
# Options:
capitalize(x, n = 3) # leaves strings intact
capitalize(x, n = 3, as_text = TRUE) # treats strings as text
capitalize(x, n = 3, upper = FALSE) # first n in lowercase
Run the code above in your browser using DataLab