capwords: Capitalize Title Format

View source: R/capwords.R

capwordsR Documentation

Capitalize Title Format

Description

Change case to capitalize first letter of each word in a character string.

Usage

capwords(x, strict = FALSE)

Arguments

x

A character string in the form of a sentence to be converted to "title case" (i.e. first letter capitalized).

strict

Logical. Should first letter capitalization be strictly applied? See example.

Value

A character string with "title case" conversion.

Author(s)

Stu Field

See Also

toupper(), tolower(), strsplit()

Examples

capwords("using AIC for model selection")
## ->  [1] "Using AIC For Model Selection"
capwords(c("using AIC", "for MODEL selection"), strict = TRUE)
## ->  [1] "Using Aic"  "For Model Selection"
##                ^^^        ^^^^^
##               "bad"       "good"

stufield/stuRpkg documentation built on April 2, 2022, 2:05 p.m.