If names contain character strings other than the levels in the old factor
and warning is set to TRUE
, a warning will be raised.
A factor
A named vector. The names of the vector are all or a subset of levels in the old factor. And the values are new levels
Actions taken in case existing levels are missing: 'pass', 'warning', or 'error'.
Actions taken in case unrecognised levels are found: 'pass', 'warning', or 'error'.
A vector of factor
The levels of the factor are the names of the ref
vector, and
the order of the ref
vector matters: it is the levels of the new factor.