home *** CD-ROM | disk | FTP | other *** search
-
- _G_e_n_e_r_a_t_e _F_a_c_t_o_r _L_e_v_e_l_s
-
- gl(n, k, length, labels=1:n, ordered=FALSE)
-
- _V_a_l_u_e:
-
- This function generates factors by specifying the pat-
- tern of their levels. The result has levels from 1 to
- n with each value replicated in groups of length k out
- to a total length of length. Labels for the resulting
- factor levels can be optionally specified with the
- arguments labels and the factor levels can be made
- ordered by specifying ordered=TRUE. gl is modelled on
- the GLIM function of the same name.
-
- _E_x_a_m_p_l_e_s:
-
- # 20 alternating 1s and 2s
- gl(2, 1, 20)
-
- # alternating pairs of 1s and 2s
- gl(2, 2, 20)
-
-