Converts all tagged NAs to regular (untagged) NA values, effectively
removing the missing value type information. Works with data from any
format: read_spss(), read_por(), read_stata(), read_sas(), or
read_xpt().
Value
The input with all tagged NAs replaced by regular NA. Value
labels for missing types are removed; labels for valid values and the
variable label are preserved. A haven_labelled input stays
haven_labelled, so the labels survive write_spss() and
write_stata(). A data frame is returned with the selected columns
converted.
See also
read_spss(), read_stata(), read_sas(), read_xpt(),
na_frequencies(), untag_na()
Other data-import:
na_frequencies(),
read_por(),
read_sas(),
read_spss(),
read_stata(),
read_xlsx(),
read_xpt(),
untag_na()
Examples
# \donttest{
if (requireNamespace("haven", quietly = TRUE)) {
x <- set_na(c(1, 2, -9, 3, -8), -9, -8)
# Remove tag information: all missings become plain NA
strip_tags(x)
}
#> <labelled<double>[5]>
#> [1] 1 2 NA 3 NA
# }
