.checkMFClasses            package:stats            R Documentation

_F_u_n_c_t_i_o_n_s _t_o _C_h_e_c_k _t_h_e _T_y_p_e _o_f _V_a_r_i_a_b_l_e_s _p_a_s_s_e_d _t_o _M_o_d_e_l _F_r_a_m_e_s

_D_e_s_c_r_i_p_t_i_o_n:

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

     '.MFclass' categorizes variables for this purpose.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

      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.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     '.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'.

