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 / gl < prev    next >
Encoding:
Text File  |  1997-04-23  |  746 b   |  25 lines

  1.     
  2.     _G_e_n_e_r_a_t_e _F_a_c_t_o_r _L_e_v_e_l_s
  3.     
  4.          gl(n, k, length, labels=1:n, ordered=FALSE)
  5.     
  6.     _V_a_l_u_e:
  7.     
  8.          This function generates factors by specifying the pat-
  9.          tern of their levels.  The result has levels from 1 to
  10.          n with each value replicated in groups of length k out
  11.          to a total length of length.  Labels for the resulting
  12.          factor levels can be optionally specified with the
  13.          arguments labels and the factor levels can be made
  14.          ordered by specifying ordered=TRUE.  gl is modelled on
  15.          the GLIM function of the same name.
  16.     
  17.     _E_x_a_m_p_l_e_s:
  18.     
  19.          # 20 alternating 1s and 2s
  20.          gl(2, 1, 20)
  21.     
  22.          # alternating pairs of 1s and 2s
  23.          gl(2, 2, 20)
  24.     
  25.