interaction              package:Hmisc              R Documentation

_C_o_m_p_u_t_e _t_h_e _I_n_t_e_r_a_c_t_i_o_n _o_f _S_e_v_e_r_a_l _F_a_c_t_o_r_s

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

     This is a replacement for the builtin function 'interaction' that
     adds the parameters 'sep' and 'left'.

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

     interaction(..., drop=FALSE, sep=".", left=FALSE)

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

     ...: the arguments to 'interaction' can be either a data frame
          containing all the factors to be used all the individual
          factors. It will not understand a combination of factors and
          designs as arguments; you have to pick one form or the other. 

    drop: if 'TRUE' the levels of the new factor not represented in the
          data are dropped. 

     sep: the separator in creating the level descriptors. 

    left: set to 'TRUE' to left-justify factor levels when constructing
          label strings 

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

     This is a slight modification of the S-supplied function.  The
     'sep' argument has been added, a sort step has been added to
     properly sort the levels of the created variable, and the 'left'
     parameter is added.

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

     a new factor, whose levels are all possible combinations of the
     factors supplied as arguments. If 'drop =TRUE', only the levels
     represented in the new factor are retained.

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

     Temp <- c(160, 180, 160, 180, 160, 180, 160, 180)
     Conc <- c(20, 20, 40, 40, 20, 20, 40, 40)
     interaction(Temp, Conc)

