

relevel {base}                               R Documentation

_R_e_o_r_d_e_r _L_e_v_e_l_s _o_f _F_a_c_t_o_r

_D_e_s_c_r_i_p_t_i_o_n_:

     The levels of a factor are re-ordered so that the level
     specified by `ref' is first and the others are moved
     down. This is useful for `contr.treatment' contrasts
     which take the first level as the reference.

_U_s_a_g_e_:

     relevel(x, ref, ...)

_A_r_g_u_m_e_n_t_s_:

       x: An unordered factor.

     ref: The reference level.

     ...: Additional arguments for future methods.

_V_a_l_u_e_:

     A factor of the same length as `x'.

_A_u_t_h_o_r_(_s_)_:

     B. D. Ripley

_S_e_e _A_l_s_o_:

     `factor', `contr.treatment'

_E_x_a_m_p_l_e_s_:

     data(warpbreaks)
     warpbreaks$tension <- relevel(warpbreaks$tension, ref="M")
     summary(lm(breaks ~ wool + tension, data=warpbreaks))

