\HeaderA{.checkMFClasses}{Functions to Check the Type of Variables passed to Model Frames}{.checkMFClasses}
\aliasA{.getXlevels}{.checkMFClasses}{.getXlevels}
\aliasA{.MFclass}{.checkMFClasses}{.MFclass}
\keyword{utilities}{.checkMFClasses}
\begin{Description}\relax
\code{.checkMFClasses} checks if the variables used in a predict
method agree in type with those used for fitting.

\code{.MFclass} categorizes variables for this purpose.
\end{Description}
\begin{Usage}
\begin{verbatim}
.checkMFClasses(cl, m, ordNotOK = FALSE)
.MFclass(x)
.getXlevels(Terms, m)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{cl}] a character vector of class descriptions to match.
\item[\code{m}] a model frame.
\item[\code{x}] any \R{} object.
\item[\code{ordNotOK}] logical: are ordered factors different?
\item[\code{Terms}] a \code{terms} object.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For applications involving \code{model.matrix} such as linear models
we do not need to differentiate between ordered factors and factors as
although these affect the coding, the coding used in the fit is
already recorded and imposed during prediction.  However, other
applications may treat ordered factors differently:
\code{\LinkA{rpart}{rpart}} does, for example.
\end{Details}
\begin{Value}
\code{.MFclass} returns a character string, one of \code{"logical"},
\code{"ordered"}, \code{"factor"}, \code{"numeric"}, \code{"nmatrix.*"}
(a numeric matrix with a number of columns appended) or \code{"other"}.

\code{.getXlevels} returns a named character vector, or \code{NULL}.
\end{Value}

