\HeaderA{expression}{Unevaluated Expressions}{expression}
\aliasA{as.expression}{expression}{as.expression}
\methaliasA{as.expression.default}{expression}{as.expression.default}
\aliasA{is.expression}{expression}{is.expression}
\keyword{programming}{expression}
\keyword{dplot}{expression}
\begin{Description}\relax
Creates or tests for objects of mode \code{"expression"}.
\end{Description}
\begin{Usage}
\begin{verbatim}
expression(...)

is.expression(x)
as.expression(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] \code{expression}: \R{} objects, typically calls, symbols
or constants.\\
\code{as.expression}: arguments to be passed to methods.
\item[\code{x}] an arbitrary \R{} object.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\sQuote{Expression} here is not being used in its colloquial sense,
that of mathematical expressions.  Those are calls (see
\code{\LinkA{call}{call}}) in \R, and an \R{} expression vector is a list of
calls, symbols etc, typically as returned by \code{\LinkA{parse}{parse}}.

As an object of mode \code{"expression"} is a list, it can be
subsetted by both \code{[} and by \code{[[}, the latter extracting
individual calls etc.

\code{expression} and \code{is.expression} are \LinkA{primitive}{primitive} functions.
\end{Details}
\begin{Value}
\code{expression} returns a vector of type \code{"expression"}
containing its arguments (unevaluated).

\code{is.expression} returns \code{TRUE} if \code{expr} is an
expression object and \code{FALSE} otherwise.

\code{as.expression} attempts to coerce its argument into an
expression object.  It is generic, and only the default method is
described here.  \code{NULL}, calls, symbols (see
\code{\LinkA{as.symbol}{as.symbol}}) and pairlists are returned as the element of
a length-one expression vector.  Vectors (including lists) are placed
element-by-element into an expression vector.  Other types are not
currently supported.
\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{\LinkA{call}{call}},
\code{\LinkA{eval}{eval}},
\code{\LinkA{function}{function}}.
Further,
\code{\LinkA{text}{text}} and
\code{\LinkA{legend}{legend}}
for plotting mathematical expressions.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
length(ex1 <- expression(1+ 0:9))# 1
ex1
eval(ex1)# 1:10

length(ex3 <- expression(u,v, 1+ 0:9))# 3
mode(ex3 [3]) # expression
mode(ex3[[3]])# call
rm(ex3)
\end{ExampleCode}
\end{Examples}

