an optional vector of labels for the resulting factor
levels.

ordered

a logical indicating whether the result should be
ordered or not.

Value

The result has levels from 1 to n with each value
replicated in groups of length k out to a total length of
length. gl is modelled on the GLIM function of the same name.