toTitleCase

0th

Percentile

Convert Titles to Title Case

Convert a character vector to title case, especially package titles.

Usage
toTitleCase(text)
Arguments
text

a character vector.

Details

This is intended for English text only.

No definition of‘title case’ is universally accepted: all agree that ‘principal’ words are capitalized and common words like ‘for’ are not, but not which words fall into each category.

Generally words in all capitals are left alone: this implementation knows about conventional mixed-case words such as ‘LaTeX’ and ‘OpenBUGS’ and a few technical terms which are not usually capitalized such as ‘jar’ and ‘xls’. However, unknown technical terms will be capitalized unless they are single words enclosed in single quotes: names of packages and libraries should be quoted in titles.

Value

A character vector of the same length as text, without names.

Aliases
  • toTitleCase
Documentation reproduced from package tools, version 3.6.0, License: Part of R 3.6.0

Community examples

richie@datacamp.com at Nov 20, 2018 tools v3.5.1

In this example, "over" and the second "the" are considered common words and not capitalized. ```r library(tools) toTitleCase("the quick brown fox jumped over the lazy dog") ``` Package names and other technical proper nouns should be placed inside single quotes to avoid capitalization. ```r library(tools) toTitleCase("I put 'ggplot2' in quotes so it wouldn't be capitalized") ```