The function droplevels
is used to drop unused levels from a factor
or, more commonly, from factors in a data.frame
. This method preserves
meta-data (e.g., label and unit of measurement).
# S4 method for annotated_factor
droplevels(x, ...)# S4 method for annotated_named_factor
droplevels(x, ...)
An annotated factor from which to drop unused levels.
Further arguments that can be passed, see droplevels
for further options.