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

Afrobarometer Vignette #31

Open
lcsanford opened this issue Jul 6, 2022 · 3 comments
Open

Afrobarometer Vignette #31

lcsanford opened this issue Jul 6, 2022 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@lcsanford
Copy link

I am trying to replicate the Afrobarometer Vignette: https://retroharmonize.dataobservatory.eu/articles/afrobarometer.html

I have copied the data files and saved them, and updated the file paths. When I run:

ab_waves <- read_surveys(afrobarometer_rounds, .f='read_spss')

I get:

Reading: merged_r6_data_2016_36countries2.sav
Reading: merged-round-5-data-34-countries-2011-2013-last-update-july-2015_0.sav
Reading: r7_merged_data_34ctry.release.sav
Warning message:
In read_spss(file = filename, user_na = TRUE) :
Error: Failed to parse /data/Afrobarometer/merged_r6_data_2016_36countries2.sav: Unable to convert string to the requested encoding (invalid byte sequence).

Returning an empty survey.

Any idea what is causing this?

@lcsanford
Copy link
Author

As I move through the vignette, a couple of other questions:
It doesn't look like merge_surveys() is a function in 2.0 or 2.5, but when I switch to merge_waves as in https://rdrr.io/cran/retroharmonize/f/inst/doc/afrobarometer.Rmd I get the following warning:

Warning messages:
1: In FUN(X[[i]], ...) :
rowid is not selected from merged-round-5-data-34-countries-2011-2013-last-update-july-2015_0.sav
2: In FUN(X[[i]], ...) :
rowid is not selected from r7_merged_data_34ctry.release.sav

@antaldaniel
Copy link
Collaborator

Hi @lcsanford, I am sorry about this. We are working on a major rewrite of the package and the vignettes, too. I'll look into this specific issue, but a new interface will come with a much better functionality.

@antaldaniel antaldaniel self-assigned this Jul 11, 2022
@antaldaniel antaldaniel added the documentation Improvements or additions to documentation label Jul 11, 2022
@antaldaniel
Copy link
Collaborator

The first issue is that one of your files is not read. That file may be corrupt. Please try to read it with haven::read_spss then retroharmonize::read_spss, and let me know if you succeed with any of these. If not, please try to open the file, if you have, with an SPSS file compatible software, and report to me the verisons of haven and retroharmonize you use.

First all files should be read into your system. I will look into the second issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants