This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/levels.html
levels {base}R Documentation

Level Names for a Factor

Description

levels provides access to the levels attribute of factor. The first form prints the levels of the observations and the second sets the levels. In this case, value must be a vector of character strings with length equal to the number of levels of x.

To find out how many levels a factor has user the function nlevels.

Usage

levels(x)
levels(x) <- value

See Also

factor, nlevels.


[Package base version 0.60 ]