nlevels(x)
nlevels
NA
The actual factor levels (if they exist) can be obtained with the levels function.
levels