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

read_por() invalid file or unsupported features (spss v25) #412

Closed
zross opened this issue Nov 9, 2018 · 5 comments

Comments

@zross
Copy link

commented Nov 9, 2018

haven is an amazing package! I use it constantly to convert SAS, SPSS and others.

It has worked perfectly to read .por files up until now. I've tested SPSS version 14, 20 and 24 and these work fine. But with the .por files from version 25 I'm getting an error.

I tried the most recent version of haven on CRAN and then I tried the version from GitHub and neither works.

I created a tiny file as both a .por and a .sav for testing (attached to this issue) and they work as .sav but not .por.

# not working
root %>% 
  path("tiny_spss25_locale.por") %>% 
  haven::read_por()

# Error in df_parse_por_file(spec, encoding = "", user_na = user_na) : 
#   Failed to parse tiny_spss25_locale.por: Invalid file, or file has unsupported features.

# This works
root %>% 
  path("tiny_spss25_locale.sav") %>% 
  haven::read_sav()

Any thoughts?

tiny_spss25_locale.zip

@zross

This comment has been minimized.

Copy link
Author

commented Nov 20, 2018

I'm seeing that this is an issue with the underlying ReadStat and I have reported it there.

@zross

This comment has been minimized.

Copy link
Author

commented Nov 20, 2018

@evanmiller has fixed this issue (thanks for the super-quick response). When you get a chance to update the version of ReadStats for Haven that would be great!

@timparsons

This comment has been minimized.

Copy link

commented Dec 7, 2018

I’m also experiencing this issue, and could really use the fix @zross mentioned as soon as possible. Thanks!

@zross

This comment has been minimized.

Copy link
Author

commented Jan 8, 2019

Version 2.0 of Haven was released and includes some great updates but does not include the update from ReadStat that allows the reading of SPSS v25. As a temporary fix, until haven includes this edit, others who have this issue can do the following:

  1. Clone haven repo
  2. Open haven/src/readstat/spss/readstat_por_read.c
  3. Make the tiny edit you see in this ReadStat commit.
  4. Build source package
  5. Install the source package.
@lock

This comment has been minimized.

Copy link

commented Jul 22, 2019

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 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.