# create labelled integer, with missing flag
x <- labelled(c(1, 2, 1, 3, 4, 1),
c(Male = 1, Female = 2, Refused = 3, "N/A" = 4),
c(FALSE, FALSE, TRUE, TRUE))
get_na_flags(x)
Run the code above in your browser using DataLab