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

Levels Attributes

Description

levels provides access to the levels attribute of a variable. The first form returns the value of the levels of its argument and the second sets the attribute.

The assignment form ("levels<-") of levels is a generic function and new methods can be written for it. The most important method is that for factors:

Usage

levels(x)
levels(x) <- value

Arguments

x

an object, for example a factor.

value

A valid value for levels(x). For the default method, NULL or a character vector.

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth \& Brooks/Cole.

See Also

levels<-.factor, nlevels.


[Package base version 1.7.1 ]