

   GGeenneerraattee FFaaccttoorr LLeevveellss

        gl(n, k, length = n*k, labels=1:n, ordered=FALSE)

   VVaalluuee::

        This function generates `factor's by specifying the
        pattern 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 spec-
        ified 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.

   SSeeee AAllssoo::

        the underlying `factor(.)'.

   EExxaammpplleess::

        # First control, then treatment:
        gl(2,8, label=c("Ctnrl","Treat"))
        # 20 alternating 1s and 2s
        gl(2, 1, 20)
        # alternating pairs of 1s and 2s
        gl(2, 2, 20)

