casemod {equate}R Documentation

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

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)

Value

Returns a string

Author(s)

Anthony Albano tony.d.albano@gmail.com

See Also

casefold, substr

Examples

casemod("latex")
casemod("latex",c(1,3,5))

[Package equate version 0.1-1 Index]