knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(gerda)
The gerda
package provides functions to access and work with GERDA datasets. The German Election Database (GERDA) provides a comprehensive dataset of local, state, and federal election results in Germany. The data is intended to facilitate research on electoral behavior, representation, and political responsiveness at multiple levels of government. All datasets include turnout and vote shares for all major parties. Moreover, GERDA contains geographically harmonized datasets that account for changes in municipal boundaries and mail-in voting districts.
GERDA was compiled by Vincent Heddesheimer, Florian Sichart, Andreas Wiedemann and Hanno Hilbig.
This vignette will introduce you to the main functions of the package and demonstrate how to use them.
To see a list of all available GERDA datasets, you can use the gerda_data_list()
function:
gerda_data_list()
This function displays a formatted table with the names and descriptions of all available datasets.
The main function for loading GERDA data is load_gerda_web()
. This function allows you to load a specific dataset from a web source. Here's an example of how to use it:
# Load the municipal harmonized dataset municipal_harm_data <- load_gerda_web("municipal_harm", verbose = TRUE, file_format = "rds")
The load_gerda_web()
function takes the following parameters:
file_name
: The name of the dataset to load (as shown in the gerda_data_list()
output)verbose
: If set to TRUE
, it prints messages about the loading process (default is FALSE
)file_format
: Specifies the format of the file to load, either "rds" or "csv" (default is "rds")Here's an example of a typical workflow using the gerda
package:
gerda_data_list()
federal_cty_harm <- load_gerda_web("federal_cty_harm", verbose = TRUE)
The gerda
package provides easy access to a wide range of German election and related data. By using the gerda_data_list()
function to explore available datasets and load_gerda_web()
to load them, you can quickly incorporate this data into your research or analysis projects.
For more information or to provide feedback, please contact hhilbig@ucdavis.edu or visit the GitHub repository at https://github.com/hhilbig/gerda.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.