Internal helper shared by the classification methods that cannot cope with empty classes.
It coerces labels to a factor (which makes it work with character vectors,
for which nlevels returns 0), drops the levels that are not observed (warning about
them) and checks that at least two classes remain.
check.classes(labels, method = "", min.classes = 2)labels, as a factor with no empty level.
Class labels (vector or factor).
The name of the calling method, used in the messages (a character string).
The minimal number of (non-empty) classes required (default: 2).