knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(knitr)
library(eurobarometer)
library(dplyr)

The ZA7562_sample is a small fraction of the GESIS datafile ZA5479_v6-0-0.sav. It cannot be used to retrieve any statistical data from the original dataset. In scope it is limited to some important metadata columns, a few demographic variables and one question block. In geographic coverage, it takes a sample from the responses from the United Kingdom and Germany. These two countries are targeting parts of the countries separately, i.e. for Great Britain and Northern Ireland, and the former West Germany and East Germany.

ZA7576_sample <- read_rds(
  system.file("examples", "ZA7576.rds", package="eurobarometer")
)

When you read data in with read_rds() or read_spss(), as many metadata is added to the survey data frame as possible.

attributes(ZA7576_sample)

For identifying variables and variable labels, the helper function gesis_metadata_create() analyzes the contents of the survey.

sample_metadata <- gesis_metadata_create(ZA7562_sample)
names(sample_metadata)

The function gesis_metadta_create() normalizes those variable names that are not machine readable, using two functions under the hood (see: label_normalize() and label_suggest().)

sample_metadata %>%
  select ( all_of(c("var_name_orig", "var_name_suggested")))


antaldaniel/eurobarometer documentation built on Aug. 31, 2020, 10:57 p.m.