Package: essurvey 1.0.8

Jorge Cimentada

essurvey: Download Data from the European Social Survey on the Fly

Download data from the European Social Survey directly from their website <http://www.europeansocialsurvey.org/>. There are two families of functions that allow you to download and interactively check all countries and rounds available.

Authors:Jorge Cimentada [aut, cre], Thomas Leeper [rev], Nujcharee Haswell [rev], Jorge Lopez [ctb], François Briatte [ctb]

essurvey_1.0.8.tar.gz
essurvey_1.0.8.zip(r-4.5)essurvey_1.0.8.zip(r-4.4)essurvey_1.0.8.zip(r-4.3)
essurvey_1.0.8.tgz(r-4.5-any)essurvey_1.0.8.tgz(r-4.4-any)essurvey_1.0.8.tgz(r-4.3-any)
essurvey_1.0.8.tar.gz(r-4.5-noble)essurvey_1.0.8.tar.gz(r-4.4-noble)
essurvey_1.0.8.tgz(r-4.4-emscripten)essurvey_1.0.8.tgz(r-4.3-emscripten)
essurvey.pdf |essurvey.html
essurvey/json (API)
NEWS

# Install 'essurvey' in R:
install.packages('essurvey', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ropensci/essurvey/issues15 issues

Pkgdown site:https://docs.ropensci.org

On CRAN:essurvey-1.0.8(2022-01-09)

Conda:

ess

6.88 score 48 stars 79 scripts 441 downloads 20 exports 39 dependencies

Last updated 3 years agofrom:b2d05a3a89 (on master). Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 25 2025
R-4.5-winOKFeb 25 2025
R-4.5-macOKFeb 25 2025
R-4.5-linuxOKFeb 25 2025
R-4.4-winOKFeb 25 2025
R-4.4-macOKFeb 25 2025
R-4.3-winOKFeb 25 2025
R-4.3-macOKFeb 25 2025

Exports:download_countrydownload_roundsdownload_sddf_countryimport_all_cntroundsimport_all_roundsimport_all_sddf_cntroundsimport_countryimport_roundsimport_sddf_countryrecode_missingsrecode_numeric_missingrecode_strings_missingset_emailshow_countriesshow_country_roundsshow_roundsshow_rounds_countryshow_sddf_cntroundsshow_theme_roundsshow_themes

Dependencies:askpassbitbit64clicliprcpp11crayoncurlfansiforcatsgluehavenhmshttrjsonlitelifecyclemagrittrmimeopensslpillarpkgconfigprettyunitsprogressR6readrrlangrvestselectrstringistringrsystibbletidyselecttzdbutf8vctrsvroomwithrxml2

Introduction to the essurvey package

Rendered fromintro_ess.Rmdusingknitr::rmarkdownon Feb 25 2025.

Last update: 2022-01-09
Started: 2018-02-20

Citation

To cite essurvey in publications use:

Cimentada, Jorge (2019). Download Data from the European Social Survey on the Fly R package version 1.0.3

Corresponding BibTeX entry:

  @Manual{,
    title = {Download Data from the European Social Survey on the Fly},
    author = {Jorge Cimentada},
    year = {2019},
    note = {R package version 1.0.3},
    url = {https://docs.ropensci.org/essurvey/},
  }

Readme and manuals

essurvey

Description

The European Social Survey (ESS) is an academically driven cross-national survey that has been conducted across Europe since its establishment in 2001. Every two years, face-to-face interviews are conducted with newly selected, cross-sectional samples. The survey measures the attitudes, beliefs and behavior patterns of diverse populations in more than thirty nations. Taken from the ESS website.

Note: The essurvey package was originally called ess. Since essurvey 1.0.0 all ess_* functions have been deprecated in favor of the import_* and download_* functions. Also, versions less than and including essurvey 1.0.1 returned wrong countries. Please install the latest CRAN/Github version.

The essurvey package is designed to download the ESS data as easily as possible. It has a few helper functions to download rounds (a term synonym to waves to denote the same survey in different time points), rounds for a selected country and to show which rounds/countries are available. Check out the vignette and other documentation in the package’s website for more detailed examples of the essurvey package.

Installation

You can install and load the development version with these commands:

# install.packages("devtools") in case you don't have it
# devtools::install_github("ropensci/essurvey")
install.packages("essurvey", repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

or the stable version with:

install.packages("essurvey")

Usage

First, you need to register at the ESS website, in case you haven’t. Please visit the register section from the ESS website. If your email is not registered at their website, an error will be raised prompting you to go register.

Set your valid email as en environment variable.

set_email("your@email.com")

To explore which rounds/countries are present in the ESS use the show_*() family of functions.

library(essurvey)
show_countries()
#>  [1] "Albania"            "Austria"            "Belgium"           
#>  [4] "Bulgaria"           "Croatia"            "Cyprus"            
#>  [7] "Czechia"            "Denmark"            "Estonia"           
#> [10] "Finland"            "France"             "Germany"           
#> [13] "Greece"             "Hungary"            "Iceland"           
#> [16] "Ireland"            "Israel"             "Italy"             
#> [19] "Kosovo"             "Latvia"             "Lithuania"         
#> [22] "Luxembourg"         "Montenegro"         "Netherlands"       
#> [25] "Norway"             "Poland"             "Portugal"          
#> [28] "Romania"            "Russian Federation" "Serbia"            
#> [31] "Slovakia"           "Slovenia"           "Spain"             
#> [34] "Sweden"             "Switzerland"        "Turkey"            
#> [37] "Ukraine"            "United Kingdom"

To download the first round to use in R:

one_round <- import_rounds(1)

This will return a data frame containing the first round. Typically, the European Social Survey data files comes with a script that recodes missing values to NA for different programs (Stata, SPSS, SAS).

Use recode_missings to recode all values automatically.

library(tidyverse)

one_round <-
  import_rounds(1) %>%
  recode_missings()

See the package vignette for greater detail or see the help page with ?recode_missings. You can also download several rounds by supplying the number of rounds.

five_rounds <- import_rounds(1:5)

This will download all latest versions of rounds 1 through 5 and return a list of length 5 with each round as a data frame inside the list.

You can check the available rounds with show_rounds() because if you supply a non existent round, the function will return an error.

two_rounds <- import_rounds(c(1, 22))
#> Error in round_url(rounds) : 
#> ESS round 22 is not a available. Check show_rounds() 

Alternatively, you can download all available rounds with import_all_rounds().

You can also download rounds by country:

dk_two <- import_country("Denmark", 1:2)

Use show_countries() to see available countries and show_country_rounds("Denmark") to see available rounds for chosen country. Alternatively, use import_all_cntrounds() to download all available rounds of a country.

You should be be aware that data from the ESS survey should by analyzed by taking into consideration the sampling and weights of the survey. A useful example comes from the work of Anthony Damico and Daniel Oberski here.

Stata, SPSS and SAS users

I’m quite aware that most ESS users don’t know R, that is why the package also allows to download the data in Stata, SPSS or SAS format with just one line of code. Instead of the import_* functions, use the download_* functions.

download_rounds(c(1, 2),
                output_dir = "my/new/directory",
                format = 'spss')

This will save the ESS rounds into separate folders and unzip them in the specified directory (if you want to know your current directory, type getwd()). This works the same way for download_country(). Be aware that if you download the files manually you should read them into R with the haven package for all essurvey related functions to work.


Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

Help Manual

Help pageTopics
Download integrated rounds separately for countries from the European Social Surveydownload_country import_all_cntrounds import_country
Download integrated rounds from the European Social Surveydownload_rounds import_all_rounds import_rounds
Download SDDF data by round for countries from the European Social Surveydownload_sddf_country import_all_sddf_cntrounds import_sddf_country
Recode pre-defined missing values as NArecode_missings recode_numeric_missing recode_strings_missing
Save your ESS email as an environment variableset_email
Return available countries in the European Social Surveyshow_countries
Return available rounds for a country in the European Social Surveyshow_country_rounds
Return available rounds in the European Social Surveyshow_rounds
Return countries that participated in *all* of the specified rounds.show_rounds_country
Return available SDDF rounds for a country in the European Social Surveyshow_sddf_cntrounds
Return available rounds for a theme in the European Social Surveyshow_theme_rounds
Return available themes in the European Social Surveyshow_themes