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

