\Header{model.frame}{Extracting the ``Environment'' of a Model Formula}
\alias{model.frame.default}{model.frame}
\alias{model.frame.lm}{model.frame}
\alias{model.frame.glm}{model.frame}
\alias{model.frame.aovlist}{model.frame}
\keyword{models}{model.frame}
\begin{Usage}
\begin{verbatim}
model.frame(formula, data, na.action, ...)
model.frame.default(formula, data=sys.frame(sys.parent()),
                    na.action = na.fail, ...)

Methods for
	lm	glm	aovlist
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{formula}] a model formula
\item[\texttt{data}] \texttt{data.frame} or \texttt{environment} where the objects
in formula are.
\item[\texttt{na.action}] how \texttt{NA}s are treated.
\item[\texttt{...}] further arguments such as.......
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{model.frame} (generic function) and its methods return a
\texttt{\Link{data.frame}} with the variables from \texttt{formula}.\end{Description}
\begin{Value}
A \texttt{\Link{data.frame}} containing the variables used in
\texttt{formula}.\end{Value}
\begin{SeeAlso}
\texttt{\Link{model.matrix}} for the ``design matrix''.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(cars)
data.class(model.frame(dist ~ speed, data = cars))
\end{ExampleCode}
\end{Examples}

