\Header{update.formula}{Model Updating}
\keyword{models}{update.formula}
\begin{Usage}
\begin{verbatim}
update.formula(old, new)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{old}] a model formula to be updated.
\item[\texttt{new}] a formula giving a template which specifies how to update.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{update.formula} is used to update model formulae.
This typically involves adding or dropping terms,
but updates can be more general.

The function works by first identifying the \emph{left-hand side}
and \emph{right-hand side} of the \texttt{old} formula.
It then examines the \texttt{new} formula and substitutes
the \emph{lhs} of the \texttt{old} formula for any occurence
of "\texttt{.}" on the left of \texttt{new}, and substitutes
the \emph{rhs} of the \texttt{old} formula for any occurence
of "\texttt{.}" on the right of \texttt{new}.

The updated formula is returned.\end{Description}
\begin{SeeAlso}
\texttt{\Link{terms}}, \texttt{\Link{model.matrix}}.\end{SeeAlso}

