Skip to Content

.checkMFClasses {stats}

Functions to Check the Type of Variables passed to Model Frames
Package: 
stats
Version: 
R 3.0.2

Description

.checkMFClasses checks if the variables used in a predict method agree in type with those used for fitting.

.MFclass categorizes variables for this purpose.

Usage

.checkMFClasses(cl, m, ordNotOK = FALSE)
.MFclass(x)
.getXlevels(Terms, m)

Arguments

cl
a character vector of class descriptions to match.
m
a model frame.
x
any R object.
ordNotOK
logical: are ordered factors different?
Terms
a terms object.

Details

For applications involving 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: rpart does, for example.

Values

.MFclass returns a character string, one of "logical", "ordered", "factor", "numeric", "nmatrix.*" (a numeric matrix with a number of columns appended) or "other".

.getXlevels returns a named character vector, or NULL.

Documentation reproduced from R 3.0.2. License: GPL-2.