All Projects → ropensci → essurvey

ropensci / essurvey

Licence: Unknown, MIT licenses found Licenses found Unknown LICENSE MIT LICENSE.md
Download data from the European Social Survey

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to essurvey

SCopeLoomR
R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ...
Stars: ✭ 25 (-46.81%)
Mutual labels:  r-package
robotstxt
robots.txt file parsing and checking for R
Stars: ✭ 65 (+38.3%)
Mutual labels:  r-package
finch
⚠️ ARCHIVED ⚠️ Read Darwin Core Archive files
Stars: ✭ 17 (-63.83%)
Mutual labels:  r-package
modeltime.ensemble
Time Series Ensemble Forecasting
Stars: ✭ 65 (+38.3%)
Mutual labels:  r-package
ggHoriPlot
A user-friendly, highly customizable R package for building horizon plots in ggplot2
Stars: ✭ 115 (+144.68%)
Mutual labels:  r-package
EGRET
An R-package for the analysis of long-term changes in water quality and streamflow, including the water-quality method Weighted Regressions on Time, Discharge, and Season (WRTDS). http://usgs-r.github.io/EGRET/
Stars: ✭ 71 (+51.06%)
Mutual labels:  r-package
hunspell
High-Performance Stemmer, Tokenizer, and Spell Checker for R
Stars: ✭ 101 (+114.89%)
Mutual labels:  r-package
vioplot
Development version of vioplot R package (CRAN maintainer)
Stars: ✭ 25 (-46.81%)
Mutual labels:  r-package
qwraps2
An updated version of qwraps with a focus on flexibility and general purpose. These functions are helpful for extracting and formatting results from R into .Rnw or .Rmd files. Additional functions for routine work such as extracting results from regression models or finding sensitivity and specificity.
Stars: ✭ 33 (-29.79%)
Mutual labels:  r-package
rcppmsgpack
MsgPack Headers for R / msgpack.org[R]
Stars: ✭ 17 (-63.83%)
Mutual labels:  r-package
hoardr
⚠️ ARCHIVED ⚠️ manage cached files
Stars: ✭ 19 (-59.57%)
Mutual labels:  r-package
mxmaps
An R package for making maps of Mexico
Stars: ✭ 60 (+27.66%)
Mutual labels:  r-package
oai
OAI-PMH R client
Stars: ✭ 13 (-72.34%)
Mutual labels:  r-package
mchtoolbox
⛔ ARCHIVED ⛔ What the Package Does (Title Case)
Stars: ✭ 13 (-72.34%)
Mutual labels:  r-package
rcheatsheet
⛔ ARCHIVED ⛔ A package to create cheatsheets
Stars: ✭ 33 (-29.79%)
Mutual labels:  r-package
mlr3spatiotempcv
Spatiotemporal resampling methods for mlr3
Stars: ✭ 43 (-8.51%)
Mutual labels:  r-package
prospectr
R package: Misc. Functions for Processing and Sample Selection of Spectroscopic Data
Stars: ✭ 26 (-44.68%)
Mutual labels:  r-package
insurancerating
R-package for actuarial pricing
Stars: ✭ 40 (-14.89%)
Mutual labels:  r-package
autumn
autumn: Fast, Modern, and Tidy-Friendly Iterative Raking in R.
Stars: ✭ 26 (-44.68%)
Mutual labels:  r-package
ropsec
㊙️ Operations security for R developers
Stars: ✭ 27 (-42.55%)
Mutual labels:  r-package

essurvey

CRAN_Status_Badge R build status Coverage status rOpensci_Badge

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")

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("[email protected]")

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].