Closed dchiu911 closed 3 years ago
It's because (effectively) all the inputs in ...
are collapsed into a single vector, so a single character vector is enough to coerce them all. While not particularly desirable, I don't think it's worth the effort to fix this.
In
fct_collapse
, if we supply named numeric vectors instead of named character vectors, we get an error pertaining tofct_recode
about the positions where we don't have named strings. However, it seems that fixing only part of the inputs withas.character()
and leaving the others as numeric vectors is sufficient. I would have expected the error to tell me there areProblems at positions: 1, 2, 3, 4, 5, 11, 12, 13, 14, 15
. Using development version offorcats
.Created on 2020-09-14 by the reprex package (v0.3.0)