\HeaderA{name}{Names and Symbols}{name}
\aliasA{as.name}{name}{as.name}
\aliasA{as.symbol}{name}{as.symbol}
\aliasA{is.name}{name}{is.name}
\aliasA{is.symbol}{name}{is.symbol}
\keyword{programming}{name}
\keyword{attribute}{name}
\begin{Description}\relax
A \sQuote{name} (also known as a \sQuote{symbol}) is a way to refer to
\R{} objects by name (rather than the value of the object, if any, bound
to that name).

\code{as.name} and \code{as.symbol} are identical: they attempt to
coerce the argument to a name.

\code{is.symbol} and the identical \code{is.name} return \code{TRUE}
or \code{FALSE} depending on whether the argument is a name or not.
\end{Description}
\begin{Usage}
\begin{verbatim}
as.symbol(x)
is.symbol(x)

as.name(x)
is.name(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] object to be coerced or tested.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{as.name} first coerces its argument internally to a character
vector (so methods for \code{as.character} are not used).  It then
takes the first element and provided it is not \code{""}, returns a
symbol of that name (and if the element is \code{NA\_character\_}, the
name is \code{`NA`}. 

\code{as.name} is implemented as \code{\LinkA{as.vector}{as.vector}(x, "symbol")},
and hence will dispatch methods for the generic function \code{as.vector}.
\end{Details}
\begin{Value}
For \code{as.name} and \code{as.symbol}, an \R{} object of type
\code{"symbol"} (see \code{\LinkA{typeof}{typeof}}).

For \code{is.name} and \code{is.symbol}, a length-one logical vector
with value \code{TRUE} or \code{FALSE}.
\end{Value}
\begin{Note}\relax
The term \sQuote{symbol} is from the LISP background of \R, whereas
\sQuote{name} has been the standard S term for this.
\end{Note}
\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{\LinkA{call}{call}}, \code{\LinkA{is.language}{is.language}}.
For the internal object mode, \code{\LinkA{typeof}{typeof}}.

\code{\LinkA{plotmath}{plotmath}} for another use of \sQuote{symbol}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
an <- as.name("arrg")
is.name(an) # TRUE
mode(an)   # name
typeof(an) # symbol
\end{ExampleCode}
\end{Examples}

