delete.response             package:base             R Documentation

_M_o_d_i_f_y _T_e_r_m_s _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     `delete.response' returns a `terms' object for the same model but
     with no response variable.

     `drop.terms' removes variables from the right-hand side of the
     model.

     `reformulate' creates a formula from a vector of strings.

_U_s_a_g_e:

     delete.response(termobj)
     reformulate(termlabels,response=NULL)
     drop.terms(termobj, dropx = NULL, keep.response = FALSE) 

_A_r_g_u_m_e_n_t_s:

 termobj: A `terms' object

termlabels: vector of strings giving the right-hand side of a model
          formula

response: string giving the left-hand side of a model formula

   dropx: vector of positions of variables to drop from the right-hand
          side of the model

keep.response: Keep the response in the resulting object?

_V_a_l_u_e:

     `delete.response' and `drop.terms' return a `terms' object.

     `reformulate' returns a `formula'.

_S_e_e _A_l_s_o:

     `terms'

_E_x_a_m_p_l_e_s:

     ff <- y ~ z + x + w
     tt <- terms(ff)
     tt
     delete.response(tt)
     drop.terms(tt, 2:3, keep.response = T)
     reformulate(attr(tt, "term.labels"))

