Skip to contents

Exports a FOKUS survey dataset generated via TODO to the private FOKUS repository.

Usage

export_survey_data(
  data,
  lang = NULL,
  merged = NULL,
  auth_token = pal::pkg_config_val("token_repo_private")
)

Arguments

data

FOKUS survey dataset. A tibble.

lang

Language. Either NULL to read the language from data's fokus_lang attribute or one of "de" or "en".

merged

Whether or not data is a merged dataset, i.e. one that includes the data from all ballot dates that were covered by FOKUS surveys up until the most recent ballot_date contained in data. See section Merged data below for details.

If NULL, a merged dataset is assumed if data covers multiple ballot_dates.

auth_token

Personal access token of a gitlab.com account with access to the private FOKUS repository.

Value

data, invisibly.

Merged data

Merged datasets differ from single-ballot-date datasets in two ways:

  1. Column labels (the label attribute) are ballot-date-independent, i.e. do not include proposal or election names, and in case of question rewordings over time, the very latest question wording of all FOKUS surveys in that canton is used (which might have been introduced only after ballot_date). So be aware that the questions in the labels do not necessarily correspond to the actual questions asked in the FOKUS survey for ballot_date.

  2. Variables whose factor levels vary across ballot dates, such as those capturing skill questions, are converted to type character. Be aware that these variables usually aren’t really comparable over time.