Rev 8655 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{chartr}\alias{chartr}\alias{tolower}\alias{toupper}\title{Character Translation}\description{Translate characters in character vectors.}\usage{chartr(old, new, x)tolower(x)toupper(x)}\arguments{\item{x}{a character vector.}\item{old}{a character string specifying the characters to betranslated.}\item{new}{a character string specifying the translations.}}\details{\code{chartr} translates each character in \code{x} that is specifiedin \code{old} to the corresponding character specified in \code{new}.Ranges are supported in the specifications, but character classes andrepreated characters are not. If \code{old} contains more charactersthan new, an error is signaled; if it contains fewer characters, theextra characters at the end of \code{new} are ignored.\code{tolower} and \code{toupper} convert upper-case characters in acharacter vector to lower-case, or vice versa. Non-alphabeticcharacters are left unchanged.}\examples{x <- "MiXeD cAsE 123"chartr("iXs", "why", x)chartr("a-cX", "D-Fw", x)tolower(x)toupper(x)}\keyword{character}