Learn R Programming

polmineR (version 0.8.9)

capitalize: Capitalize character vector.

Description

Make the first character of the elements of a character vector have upper case and the rest lower case.

Usage

capitalize(x)

Arguments

x

A character vector.

Details

The capitalize() function may be useful when applying lowercased dictionaries of stoplists, a sentiment dictionary etc. on a CWB corpus that maintains capitalization (tokens are not lowercased).

This function is inspired by a method Python offers for string objects.

Examples

Run this code
capitalize(c("oil", "corpus", "data"))

Run the code above in your browser using DataLab