strengejacke / sjlabelled

Working with Labelled Data in R

Home Page:https://strengejacke.github.io/sjlabelled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remove_labels does not work when factor levels are strings

iago-pssjd opened this issue · comments

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).

Do you have a reproducible example?

Yes.

z <- factor(LETTERS[3:1], ordered = TRUE)
z <- sjlabelled::set_labels(z, labels = c("yes", "maybe", "no"))
sjlabelled::remove_labels(z, labels = 2)