x <- declared(
c(-2, 1:5, -1),
labels = c("Good" = 1, "Bad" = 5, "DK" = -1),
na_values = c(-1, -2),
label = "Test variable"
)
x
undeclare(x)
drop_na(x)
drop(x)
undeclare(x, drop = TRUE)
# similar to:
drop(undeclare(x))
Run the code above in your browser using DataLab