

   FFaaccttoorr CCooddeess

        codes(x)
        codes(x) <- y

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

        This function retrieves the underlying integer codes
        used for the levels of a factor and can also be used to
        reset (a subset of) these codes.

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

        `factor', `levels', `nlevels'.

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

        x <- gl(3,5,15)
        codes(x)[3] <- 2
        all(unique(codes(x)) == 1:nlevels(x))#- should be true for ALL factors

