dot-nlevels function

Count number of levels from a data.frame/table, list, or SpatRaster