\Header{nchar}{Count the Number of Characters}
\keyword{character}{nchar}
\begin{Description}\relax
\code{nchar} takes a character vector as an argument and
returns a vector whose elements contain the number of characters in
the corresponding element of \code{x}.
\end{Description}
\begin{Usage}
\begin{verbatim}nchar(x)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] character vector, or a vector to be coerced to a character
vector.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The internal equivalent of \code{\Link{as.character}} is performed on
\code{x}. If you want to operate
on non-vector objects passing them through \code{\Link{deparse}} first
will be required.
\end{Details}
\begin{Value}
The number of characters as the string will be printed (integer
\code{2} for a missing string).
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{strwidth}} giving width of strings for plotting;
\code{\Link{paste}}, \code{\Link{substr}}, \code{\Link{strsplit}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- c("asfef","qwerty","yuiop[","b","stuff.blah.yech")
nchar(x)
# 5  6  6  1 15

nchar(deparse(mean))
# 23  1 16 45 11 64  2 17 50 43  2 17  1
\end{ExampleCode}
\end{Examples}

