[ top | up ]

Factor Codes

Syntax

codes(x)
codes(x) <- y

Value

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

Examples

x <- gl(3,5,15) codes(x)[3] <- 2