transform                package:base                R Documentation

_T_r_a_n_s_f_o_r_m _a_n _O_b_j_e_c_t, _f_o_r _E_x_a_m_p_l_e _a _D_a_t_a _F_r_a_m_e

_D_e_s_c_r_i_p_t_i_o_n:

     'transform' is a generic function, which-at least currently-only
     does anything useful with data frames. 'transform.default'
     converts its first argument to a data frame if possible and calls
     'transform.data.frame'.

_U_s_a_g_e:

     transform(x, ...)

_A_r_g_u_m_e_n_t_s:

       x: The object to be transformed

     ...: Further arguments of the form 'tag=value'

_D_e_t_a_i_l_s:

     The '...' arguments to 'transform.data.frame' are tagged vector
     expressions, which are evaluated in the data frame 'x'.  The tags
     are matched against 'names(x)', and for those that match, the
     value replace the corresponding variable in 'x', and the others
     are appended to 'x'.

_V_a_l_u_e:

     The modified value of 'x'.

_N_o_t_e:

     If some of the values are not vectors of the appropriate length,
     you deserve whatever you get!

_A_u_t_h_o_r(_s):

     Peter Dalgaard

_S_e_e _A_l_s_o:

     'subset', 'list', 'data.frame'

_E_x_a_m_p_l_e_s:

     transform(airquality, Ozone = -Ozone)
     transform(airquality, new = -Ozone, Temp = (Temp-32)/1.8)

     attach(airquality)
     transform(Ozone, logOzone = log(Ozone)) # marginally interesting ...
     detach(airquality)

