\HeaderA{protectMetachar}{Protect Metacharacters}{protectMetachar}
\keyword{character}{protectMetachar}
\begin{Description}\relax
Add backslashes before any metacharacters found in a string.
\end{Description}
\begin{Usage}
\begin{verbatim}
protectMetachar(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] character vector
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function is used to protect strings containing metacharacters so that the metacharacters can be treated as ordinary characters in string matching functions operations.
\end{Details}
\begin{Value}
A character vector of the same length as \code{x} in which two backslashes have been inserted before any metacharacter.
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
An overview of LIMMA functions for reading data is given in \LinkA{03.ReadingData}{03.ReadingData}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# without protectMetachar, this would be no match
grep(protectMetachar("Ch1 (mean)"),"Ch1 (mean)")
\end{ExampleCode}
\end{Examples}

