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

read_sav reads character empty columns as numeric #311

Closed
samuelhuerga opened this Issue Aug 25, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@samuelhuerga
Copy link

samuelhuerga commented Aug 25, 2017

In read_sav, if I try to read a character empty column (i.e, all values are empty string: ""), it is shown as a numeric column with values 6.01347e-154

test <- data_frame(col = c("",""))
test
write_sav(test, "~/test.sav")

test_read <- read_sav("~/test.sav")
test_read
> test
# A tibble: 2 x 1
    col
  <chr>
1      
2      

> test_read
# A tibble: 2 x 1
           col
         <dbl>
1 6.01347e-154
2 6.01347e-154

In SPSS it appears correctly:
image
image

I've tried new version 1.1.0, but still occurs.
Is there something I am missing?

Thanks!

@ecortens

This comment has been minimized.

Copy link
Contributor

ecortens commented Oct 2, 2017

I'm seeing this same issue, in haven 1.1.0 from CRAN and haven 1.1.0.9000 on github (7f2b479).

I tried installing haven 1.0.0 from CRAN, and the issue is still present.

However, it is not present in 0.2.1 from CRAN.

I'm seeing the issue in R 3.4.1 on both Windows 7 and MacOS 10.12.6.

@evanmiller

This comment has been minimized.

Copy link
Contributor

evanmiller commented Oct 6, 2017

Should be fixed in WizardMac/ReadStat@d0c922b

ecortens added a commit to ecortens/haven that referenced this issue Oct 6, 2017

@ecortens

This comment has been minimized.

Copy link
Contributor

ecortens commented Oct 6, 2017

Thanks @evanmiller! I've just submitted PR #316 to haven, which incorporates the latest fix in ReadStat.

@hadley hadley closed this in f66bca7 Jan 7, 2018

@lock

This comment has been minimized.

Copy link

lock bot commented Jul 6, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jul 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.