Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in if (any(bad_labels)) { : missing value where TRUE/FALSE needed with write_dta #427

Closed
tlichard opened this issue Feb 13, 2019 · 3 comments
Labels
reprex needs a minimal reproducible example

Comments

@tlichard
Copy link

Hi!

I successfully imported this SPSS file
http://vs-web-fs-1.oecd.org/piaac/PUF-Data/SPSS/prgautp1.sav. But then I tried to export it as a dta file and encountered the following error: "Error in if (any(bad_labels)) { : missing value where TRUE/FALSE needed"
My code:
library(haven)
library(plyr)
data1 <- read_sav("./spss/prgautp1.sav")
write_dta(data1, "./piaac.dta")
R version 3.5.1
haven version 2.0.0.9000 468bff2

@hadley
Copy link
Member

hadley commented Nov 6, 2019

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down the page. Please make sure your reprex is created with the reprex package as it gives nicely formatted output and avoids a number of common pitfalls.

@hadley hadley added the reprex needs a minimal reproducible example label Nov 6, 2019
@tlichard
Copy link
Author

tlichard commented Dec 2, 2019

The link you provided is a 404, so I hope I did it right:

library(haven)
data1 <- read_sav("./spss/prgautp1.sav")
write_dta(data1, "./piaac.dta")
#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range

#> Warning in is_integerish(attr(x, "labels")): NAs introduced by coercion to
#> integer range
#> Error in if (any(bad_labels)) {: missing value where TRUE/FALSE needed

Created on 2019-12-02 by the reprex package (v0.3.0)

@hadley
Copy link
Member

hadley commented Apr 20, 2020

I can't download that file, so unfortunately I can't look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants