nlevels function

Number of categories in a categorical raster