formula2string           package:cwhstring           R Documentation

_E_x_t_r_a_c_t _s_i_d_e_s _o_f _a _f_o_r_m_u_l_a _t_o _s_t_r_i_n_g_s

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

     'formula2string' Returns the left and the right hand sides of a
     formula.

     'formula2term.names' Returns one chosen side of a formula.

     'formula2Rterm.names' Returns the right hand side of a formula.

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

     formula2string(form)
     formula2term.names(form,side)
     formula2Rterm.names(form)

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

    form: a formula.

    side: one of "left","right".

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

     'formula2string': Character vector containing the string
     representation of the formulas side(s).

_N_o_t_e:

     uses 'strsplit'

_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 'formula2string' is 'str2formula'.

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

     formula2string(a ~ b + c)  #  $left: "a"   $right: "b+c"
     formula2string(~ b + c)    #  $left: ""    $right: "b+c"
     formula2string(a ~ .)      #  $left: "a"   $right: "."
     formula2term.names(a ~ b1 + c,"left")  #   "a"
     formula2Rterm.names(a ~ b1 + c)        #   "b1" "c"

