home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / split < prev    next >
Encoding:
Text File  |  1997-04-23  |  709 b   |  29 lines

  1.     
  2.     _D_i_v_i_d_e _i_n_t_o _G_r_o_u_p_s
  3.     
  4.          split(x, groups)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.                x : vector containing the values to be divided
  9.                    into groups.
  10.     
  11.            group : a factor which defines the grouping.
  12.     
  13.     _D_e_s_c_r_i_p_t_i_o_n:
  14.     
  15.          split divides the data in the vector x into the groups
  16.          defined by the factor groups.
  17.     
  18.          The value returned is a list of vectors containing the
  19.          values for the groups.  The components of the list are
  20.          named by the factor levels of group.
  21.     
  22.     _E_x_a_m_p_l_e_s:
  23.     
  24.          xa <- split(x, age)
  25.          lapply(xa, mean)
  26.          #split a matrix into a list by columns
  27.          split(x,col(x))
  28.     
  29.