capitalize: Capitalize character vector.

View source: R/utils.R

capitalizeR Documentation

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

capitalize(c("oil", "corpus", "data"))

polmineR documentation built on Nov. 2, 2023, 5:52 p.m.