str2formula            package:cwhstring            R Documentation

_C_o_n_v_e_r_t _b_a_c_k _t_o _a _f_o_r_m_u_l_a

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

     'str2formula' is the inverse function to 'formula2string'.
     'term.names2formula' combines two vectors of strings into a
     formula.

_U_s_a_g_e:

       str2formula(s)
       term.names2formula(ls,rs)

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

       s: A 'list(left,right)' containing the string representation of
          the left and the right hand side of the formula (one string
          each).

      ls: A character vector (usually of length 1) containing the names
          of the terms on the left hand side of the formula.

      rs: A character vector containing the names of the terms on the
          right hand side of the formula.

_V_a_l_u_e:

     A formula.

_A_u_t_h_o_r(_s):

     Christian W. Hoffmann, christian.hoffmann@wsl.ch, <URL:
     http://www.wsl.ch/staff/christian.hoffmann>

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

     The inverse function to 'str2formula' is 'formula2string'. The
     inverse functions to 'term.names2formula' are 'formula2term.names'
     and 'formula2Rterm.names'.

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

     fo <- a ~ b + c
     abc <- formula2string(fo)  #  $left: "a"   $right: "b+c"
     str2formula(abc)    # a ~ b + c
     term.names2formula(formula2term.names(fo,"left"),c(formula2Rterm.names(fo),"X")) 
      # a ~ b + c + X

