{"id":31715227,"url":"https://github.com/max-alletsee/tidy_bundestag","last_synced_at":"2026-07-22T23:31:36.036Z","repository":{"id":176314896,"uuid":"115202099","full_name":"max-alletsee/tidy_bundestag","owner":"max-alletsee","description":"Tidy data for the Bundestag election results in Germany","archived":false,"fork":false,"pushed_at":"2018-03-11T18:01:38.000Z","size":1053,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T01:56:13.937Z","etag":null,"topics":["dataset","election-data","election-results","r","tidy-data"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/max-alletsee.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-23T14:51:52.000Z","updated_at":"2022-10-19T15:25:17.000Z","dependencies_parsed_at":"2023-11-21T18:08:00.106Z","dependency_job_id":"65a6f1dc-5548-480f-b7eb-5e5581122e5e","html_url":"https://github.com/max-alletsee/tidy_bundestag","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"2f1c379d5a0eb6d9be577c77a483b3072403b900"},"previous_names":["max-alletsee/tidy_bundestag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/max-alletsee/tidy_bundestag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-alletsee%2Ftidy_bundestag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-alletsee%2Ftidy_bundestag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-alletsee%2Ftidy_bundestag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-alletsee%2Ftidy_bundestag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/max-alletsee","download_url":"https://codeload.github.com/max-alletsee/tidy_bundestag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-alletsee%2Ftidy_bundestag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35782270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataset","election-data","election-results","r","tidy-data"],"created_at":"2025-10-09T01:52:16.530Z","updated_at":"2026-07-22T23:31:36.022Z","avatar_url":"https://github.com/max-alletsee.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"tidy\\_bundestag\n================\n\nThis repository contains R code to create tidy datasets for the German Bundestag election results.\n\nThe original data is provided by the [Federal Returning Officer (Bundeswahlleiter)](https://www.bundeswahlleiter.de/). The concept of tidy data is explained by Hadley Wickham [in his article \"Tidy Data\"](https://www.jstatsoft.org/article/view/v059i10/v59i10.pdf) in the *Journal of Statistical Software* (2014, Vol. 59, Issue 10).\n\nNote that this is currently work in progress: I started with the 1949 Bundestag elections and will slowly work towards more recent elections. This project has been inspired by similar projects from [Arndt Leininger](https://gitlab.com/arndtl/tidy_kerg) and [Marie-Louise Timcke](https://interaktiv.morgenpost.de/analyse-bundestagswahl-2017/data/btw17_analysis.html) who both focused on the 2017 elections.\n\nFolders and Files\n-----------------\n\nThe folder **`code`** contains the R code to transform the un-tidy raw data into tidy data. The file names refer to the election years: `tidy_1949.r` refers to the 1949 Bundestag elections.\n\nThe original data as provided on the website of the Federal Returning Officer can be found in the folder **`data_raw`**. The resulting tidy datasets that are created when running the R code are stored in the folder **`data_tidy`**.\n\nVariable Structure\n------------------\n\nThe R code creates two different files for each election: `..._districts` includes district-level results, whereas `..._states` shows results for the states (Länder) and for the federal level.\n\nEach row in the tidy dataset shows the election results for one party in one electoral district in one election for one type of vote (\"Erststimme\", \"Zweitstimme\"). The tidy datasets have the following variable structure:\n\n-   `district_no`: number of the electoral district\n-   `district_name`: name of the electoral district\n-   `state`: name of the state to which the electoral district belongs (for results on state level: abbreviated name of the state)\n-   `party_short`: abbreviated party name\n-   `party_long`: full party name\n-   `vote_type`: \"Erststimme\", \"Zweitstimme\"\n-   `year`: year of election\n-   `votes_party_district`: absolute number of votes for the respective party in the electoral district\n-   `voteshare_party_district`: vote share for the respective party in the electoral district, in %\n-   `voters_district`: total number of voters in the respective electoral district (both valid and invalid votes)\n-   `validvotes_district`: valid votes for all parties in the respective electoral district\n-   `invalidvotes_district`: invalid votes in the respective electoral district\n-   `eligible_district`: absolute number of eligible voters in the respective district\n-   `turnout_district`: voter turnout in the electoral district, in %\n\nOriginal Data\n-------------\n\nThe Federal Returning Officer provides a PDF file with an overview of all Bundestag elections: [Ergebnisse früherer Bundestagswahlen](https://bundeswahlleiter.de/dam/jcr/397735e3-0585-46f6-a0b5-2c60c5b83de6/btw_ab49_gesamt.pdf).\n\nMoreover, there are separate websites with the results for each election as well the possibility to download the raw data:\n\n-   1949 Bundestag elections: [website](https://bundeswahlleiter.de/bundestagswahlen/1949.html), [raw csv data](https://bundeswahlleiter.de/dam/jcr/d1ffdb9b-3d79-45a3-8e25-6a867c34d202/btw49_kerg.csv)\n-   1953 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1953.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/44e3b6bb-dfd4-4474-a9e5-7d57b507339e/btw53_kerg.csv)\n-   1957 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1957.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/6410974f-692e-466c-9fcb-98b1428cc73f/btw57_kerg.csv)\n-   1961 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1961.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/31655810-7fd3-46bd-827c-98e0fd39661f/btw61_kerg.csv)\n-   1965 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1965.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/326bd367-22d9-4a81-9800-1e159460a6f0/btw65_kerg.csv)\n-   1969 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1969.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/a372364b-236e-430f-855c-8014ea17700f/btw69_kerg.csv)\n-   1972 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1972.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/9b3b215a-2f4e-42b5-9abe-1f8b73e6717a/btw72_kerg.csv)\n-   1976 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/1976.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/eb10180e-d751-4827-8e12-94818bd0992c/btw76_kerg.csv)\n-   *(some elections are still missing here)*\n-   2005 Bundestag elections: [website](https://www.bundeswahlleiter.de/bundestagswahlen/2005.html), [raw csv data](https://www.bundeswahlleiter.de/dam/jcr/01e65a67-6d5b-47ee-b8ec-0fd243493ebc/btw05_kerg.csv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-alletsee%2Ftidy_bundestag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax-alletsee%2Ftidy_bundestag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-alletsee%2Ftidy_bundestag/lists"}