Closed
Description
openedon Apr 13, 2018
Example:
tmp <- tempdir()
x1 <- labelled(
sample(-1:5),
c(Good = -1, Bad = 5)
)
df <- tibble::data_frame(x1, z = 1:7)
as_factor(df)
write_dta(df, paste0(tmp,"/df.dta"),version=14)
df1 <- read_dta(paste0(tmp,"/df.dta"))
as_factor(df1)
Here the result of as_factor(df)
contains a row Good 7
, while the corresponding row of as_factor(df1)
is -1 7.00
.
The produced Stata file is correct:
. label list x1
x1:
-1 Good
5 Bad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment