remove_labels does not work when factor levels are strings
iago-pssjd opened this issue · comments
iago-pssjd commented
When I try to remove an sj
-label with sjlabelled::remove_labels
from a factor whose levels are not numbers, but strings, all labels are deleted with a warning message (something like NA's introduced by coercion
).
Daniel commented
Do you have a reproducible example?
iago-pssjd commented
Yes.
z <- factor(LETTERS[3:1], ordered = TRUE)
z <- sjlabelled::set_labels(z, labels = c("yes", "maybe", "no"))
sjlabelled::remove_labels(z, labels = 2)