Skip to content
Prev 43153 / 398506 Next

Levels number of a factor object

On Fri, 2004-01-23 at 08:24, Laurent Houdusse wrote:
Use nlevels() for the number of levels and levels() to get the actual
level values:
[1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4
[35] 4 4 4 4 4 4
Levels: 1 2 3 4
[1] 4
[1] "1" "2" "3" "4"

See ?nlevels and ?levels for more information.

HTH,

Marc Schwartz