It is what the title says: in the odd case where one factor level is an empty string, strange things happen (see html-notebook).
with write_vc():
writing the dataframe for the first time, and reading it back in poses no problem: the same dataframe is returned. Also, existing NA-values for the factor are handled well, and distinguished from the empty-string level.
however writing it (unchanged) for the second time gives the error:
Error: new factor labels for var
new indices labels for var
when adding strict = FALSE (which shouldn't be needed), it appears that the empty string is replaced by NA values, resulting in potentially large diffs (which, in my real case, is my problem at hand)
When relabelling the level with relabel(), an extra label is added in the yml file; the old label remains and indices remain unchanged.
It is what the title says: in the odd case where one factor level is an empty string, strange things happen (see html-notebook).
with
write_vc()
:NA
-values for the factor are handled well, and distinguished from the empty-string level.strict = FALSE
(which shouldn't be needed), it appears that the empty string is replaced byNA
values, resulting in potentially large diffs (which, in my real case, is my problem at hand)When relabelling the level with
relabel()
, an extra label is added in theyml
file; the old label remains and indices remain unchanged.