\HeaderA{terms.formula}{Construct a terms Object from a Formula}{terms.formula}
\keyword{models}{terms.formula}
\begin{Description}\relax
This function takes a formula and some optional arguments and
constructs a terms object. The terms object can then be used to
construct a \code{\LinkA{model.matrix}{model.matrix}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'formula':
terms(x, specials = NULL, abb = NULL, data = NULL, neg.out = TRUE,
      keep.order = FALSE, simplify = FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a formula.
\item[\code{specials}] which functions in the formula should be marked as
special in the \code{terms} object.
\item[\code{abb}] Not implemented in \R.
\item[\code{data}] a data frame from which the meaning of the special symbol
\code{.} can be inferred. It is unused if there is no \code{.} in
the formula.
\item[\code{neg.out}] Not implemented in \R.
\item[\code{keep.order}] a logical value indicating whether the terms should
keep their positions. If \code{FALSE} the terms are reordered so
that main effects come first, followed by the interactions,
all second-order, all third-order and so on.  Effects of a given
order are kept in the order specified.
\item[\code{simplify}] should the formula be expanded and simplified, the
pre-1.7.0 behaviour?
\item[\code{...}] further arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Not all of the options work in the same way that they do in S and not
all are implemented.
\end{Details}
\begin{Value}
A \code{\LinkA{terms.object}{terms.object}} object is returned.  The object itself is
the re-ordered (unless \code{keep.order = TRUE}) formula.  In all
cases variables within an interaction term in the formula are
re-ordered by the ordering of the \code{"variables"} attribute, which
is the order in which the variables occur in the formula.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{terms}{terms}}, \code{\LinkA{terms.object}{terms.object}}
\end{SeeAlso}

