h_as_factor.Rd
Transforming Empty Strings and White Spaces to Explicit NAs while Preserving Label
h_as_factor(x, na_level = "<Missing>")
(vector
) input to be turned into factor with explicit missing level.
(character
) the label to encode missing levels.
factor
with explicit NA and the same label as the input.
This function preserves the label attribute.