levels of an object. This is
most useful for
factors and
bdFactors.
levels(x) levels(x) <- value
bdCharacter.
x has
levels, then the
levels are returned;
otherwise
NULL.
Using
levels<- makes sure that the length of
value is the same as the length of
the (old) levels of
x, but you can combine factors by giving them
the same level.
If
value is a list and
x is a factor, the method returns
merge.levels(x, value). See
merge.levels for details on
how this may be used to combine or add levels to a factor.
levels(fuel.frame$Type[1:9]) #demonstrates drop levels(fuel.frame$Type[1:9, drop=TRUE])