-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
Information about missing values is lost, roundtrip reprex below
library(haven)
library(tibble)
test <- tibble(A = labelled_spss(1:10, c(Good = 1, Bad = 8, DK = 9, NR = 10), na_values = c(9, 10)))
test$A
# <labelled_spss<integer>[10]>
# [1] 1 2 3 4 5 6 7 8 9 10
# Missing values: 9, 10
# Labels:
# value label
# 1 Good
# 8 Bad
# 9 DK
# 10 NR
write_sav(test, "test.sav")
testback <- read_sav("test.sav")
testback$A
# <labelled<double>[10]>
# [1] 1 2 3 4 5 6 7 8 9 10
# Labels:
# value label
# 1 Good
# 8 Bad
# 9 DK
# 10 NR
Metadata
Metadata
Assignees
Labels
No labels