Learn R Programming

equate (version 0.1-0)

casemod: Lettercase Modification

Description

This function changes the case of specified letters within a string

Usage

casemod(x, chars = 1, upper = TRUE)

Arguments

x
string
chars
vector of integers indexing the characters to be modified (see below for details)
upper
logical. If TRUE (default), specified characters will be set to uppercase, otherwise lowercase

Value

  • Returns a string

Details

By default the first letter is capitalized. chars is truncated to be of length length(x) and may only contain values between 1 and nchar(x)

See Also

casefold, substr

Examples

Run this code
casemod("latex")
casemod("latex",c(1,3,5))

Run the code above in your browser using DataLab