cro                   package:eha                   R Documentation

_C_r_e_a_t_e_s _a _m_i_n_i_m_a_l _r_e_p_r_e_s_e_n_t_a_t_i_o_n _o_f _a _d_a_t_a _f_r_a_m_e.

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

     Given a data frame with a defined response variable, this function
     creates a unique representation of the covariates in the data
     frame, vector (matrix) of responses, and a pointer vector,
     connecting the responses with the corresponding covariates.

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

     cro(dat, response=1)

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

     dat: A data frame

response: The column(s) where the response resides.

_D_e_t_a_i_l_s:

     The rows in the data frame are converted to text strings with
     'paste' and compared with 'match'.

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

     A list with components 

       y: The response.

   covar: A data frame with unique rows of covariates.

    keys: Pointers from 'y' to 'covar', connecting each response with
          its covariate vector.

_N_o_t_e:

     This function is based on suggestions by Anne York and Brian
     Ripley.

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

     Gran Brostrm

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

     'match', 'paste'

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

     dat <- data.frame(y = c(1.1, 2.3, 0.7), x1 = c(1, 0, 1), x2 = c(0, 1, 0))
     cro(dat)

