# \donttest{
if (requireNamespace("haven", quietly = TRUE)) {
# Roundtrip through a temporary .xpt transport file
tmp <- tempfile(fileext = ".xpt")
write_xpt(survey_data, tmp)
data <- read_xpt(tmp)
# Read with numeric missing codes tagged as distinct NA types
data <- read_xpt(tmp, tag_na = c(-9, -8))
unlink(tmp)
}
# }
Run the code above in your browser using DataLab