Q:

How to change class of variable 'labelled' into string or chr in R?

How can i change a variable of class 'labelled' into a character variable only showing the labels as string or character? So i only want to see the last attribute, see below for the structure of my variable.
Class 'labelled'  atomic [1:918] 4 12 13 20 26 36 40 1 4 13 ...
..- attr(*, "format.spss")= chr "F8.0"
..- attr(*, "labels")= Named num [1:40] 1 2 3 4 5 6 7 8 9 10 ...
.. ..- attr(*, "names")= chr [1:40] "People management" "HR" "Self management" "Email" ...

A:

I had the same question and couldn't find a designated function. 
Converting to factor then character should work, though:
s2 <- labelled(c(1, 1, 2), c(Male = 1, Female = 2)) # example from haven:labelled
as.character(as_factor(s2)) # use haven::as_factor

