Closed billdenney closed 1 year ago
One of the design principles of forcats is to be strict about inputs in order to avoid silently propagating mistakes. Adding an as.character()
is only a small amount of extra code and it makes it very clear that you're deliberately turning numbers into factors.
Base R appears to convert integer and numeric inputs to character before making them factors. I think that similar functionality would be helpful in
forcats
. In the example below, my request is that both the integer and numeric input methods succeed:Created on 2022-12-12 with reprex v2.0.2