h_factor_ref {mmrm} | R Documentation |
Convert Character to Factor Following Reference
h_factor_ref(x, ref, var_name = vname(x))
x |
( |
ref |
( |
var_name |
( |
Use ref
to convert x
into factor with the same levels.
This is needed even if x
and ref
are both character
because
in model.matrix
if x
only has one level there could be errors.