The goal of
eurobarometer is converting Eurobarometer microdata files, as stored by GESIS, into tidy R data frames and help common pre-processing problems. The more generic function for retrospecitve (ex post) survey harmonization can be found in the package retroharmonize.
Please report all issues to github.com/antaldaniel/eurobarometer/issues.
If you use
eurobarometer in your work, please cite the package.
# install.packages("devtools") devtools::install_github("antaldaniel/retroharmonize") devtools::install_github("antaldaniel/eurobarometer")
The microdata of the European Commissions Eurobarometer surveys are stored and accessible in GESIS. They are not ready for programmatic use in R or for joining into longitudinal panels. We created this package to help this procedure following the principles of reproducible research.
We import the GESIS SPSS files with the help of the adopted version of
read_spss() from the haven package. The
haven::write_sav() function does not work perfectly, it loses some metadata, so the best is to save you data as an
.rds file. You can read surveys then with
read_rds(). Both importing function will try to add important metadata to the
retroharmonize::survey() tibble/data.frame class, including the original file name, the survey’s ID and DOI.
We analyse the files with
gesis_metadata_create() to understand what are the possible problems in the SPSS file and how to resolve them. (See: Working With Metadata or
vignette("metadata")) This is a modified version of the more generic metadata_create function in
retroharmonize. See the Working With Metadata vignette for some more details.
We convert the variables to a modified version of the
retroharmonize_labelled_spss_survey class that contains the harmonized values, harmonized labels, harmonized missing values codes of the variable with their history (original values, labels, and function applied to change them) for reproducibility. The labelled_spss_survey class inherits most of the functionality of the packages haven, labelled and are expected to work well with sjlabelled.
The harmonization of the variable names is currently possible with retroharmonize only (See: Harmonize Value Labels). Further, Eurobarometer specific helpers will be added soon. See the article Survey Data Harmonization as a case study.
Workflow from ‘Introduction to labelled by Joseph Larmaranged’
Our approach follows
Approach B to allow the conversion of harmonized and joined files back into SPSS.
The regional boundaries are consistently used, coded and named - this will be harmonized with the package regions, which helps resolving common issues, and to properly join various Eurobarometer files with Eurostat data tables and Google data tables.
This will also allow you to create regional statistics from Eurobarometer microdata files.
Please note that the
eurobarometer project is released with a Contributor Code of Conduct. By contributing to this project, you agree to its terms.