Learn R Programming

useful (version 1.2.6.1)

subOut: Sub special characters out of a character vector.

Description

Converts each of the special characters to their escaped equivalents in each element of a single vector.

Usage

subOut(toAlter, specialChars = c("!", "(", ")", "-", "=", "*", "."))

Value

toAlter is returned with any of the defined specialChars subbed out for their escaped equivalents

Arguments

toAlter

Character vector that will be altered by subbing the special characters with their escaped equivalents

specialChars

The characters to be subbed out

Author

Jared P. Lander www.jaredlander.com

Details

Each element in the specialChar vector is subbed for its escaped equivalent in each of the elements of toAlter

See Also

sub subSpecials

Examples

Run this code

subOut(c("Hello", "(parens)", "Excited! Mark"))
subOut(c("Hello", "(parens)", "Excited! Mark"), specialChars=c("!", "("))

Run the code above in your browser using DataLab