The Number of Levels of a Factor
Return the number of levels which its argument has.
- an object, usually a factor.
This is usually applied to a factor, but other objects can have levels.
The actual factor levels (if they exist) can be obtained
The length of
levels(x), which is zero if
xhas no levels.
nlevels(gl(3, 7)) # = 3
Looks like there are no examples yet.