tagged_na_to_user_na {labelled} | R Documentation |
tagged_na_to_user_na()
is the opposite of user_na_to_tagged_na()
and convert
tagged NA
into user defined missing values (see labelled_spss()
).
tagged_na_to_user_na(x, user_na_start = NULL) tagged_na_to_regular_na(x)
x |
a vector or a data frame |
user_na_start |
minimum value of the new user na, if |
tagged_na_to_regular_na()
converts tagged NAs into regular NAs.
x <- c(1:5, tagged_na("a"), tagged_na("z"), NA) x print_tagged_na(x) tagged_na_to_user_na(x) tagged_na_to_user_na(x, user_na_start = 10) y <- c(1, 0, 1, tagged_na("r"), 0, tagged_na("d")) val_labels(y) <- c( no = 0, yes = 1, "don't know" = tagged_na("d"), refusal = tagged_na("r") ) y tagged_na_to_user_na(y, user_na_start = 8) tagged_na_to_regular_na(y) tagged_na_to_regular_na(y) %>% is_tagged_na()