nlevelsR Documentation

The Number of Levels of a Factor

Description

Return the number of levels which its argument has.

Usage

## S4 method for signature 'fmVFactor'
nlevels(x)

Arguments

x

a FlashR factor

Details

This is applied to a FlashR factor.

Value

The length of levels(x), which is zero if x has no levels.

Examples

vec <- fm.as.factor(as.integer(fm.runif(100, min=0, max=100)))
nlevels(vec)