{"id":14068552,"url":"https://github.com/adibender/coalitions","last_synced_at":"2025-04-28T17:03:34.367Z","repository":{"id":11660655,"uuid":"14168815","full_name":"adibender/coalitions","owner":"adibender","description":"Coalition probabilities in multi-party democracies","archived":false,"fork":false,"pushed_at":"2024-07-22T11:08:12.000Z","size":6858,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T07:47:25.802Z","etag":null,"topics":["coalition-probabilities","election-analysis","elections","r","rstats"],"latest_commit_sha":null,"homepage":"https://adibender.github.io/coalitions/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adibender.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-06T09:56:30.000Z","updated_at":"2025-02-26T20:21:37.000Z","dependencies_parsed_at":"2024-07-22T13:06:38.624Z","dependency_job_id":null,"html_url":"https://github.com/adibender/coalitions","commit_stats":{"total_commits":349,"total_committers":13,"mean_commits":"26.846153846153847","dds":"0.23495702005730656","last_synced_commit":"8d1c43fcf3d736cc26146c855e59e734abd9488c"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibender%2Fcoalitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibender%2Fcoalitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibender%2Fcoalitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibender%2Fcoalitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adibender","download_url":"https://codeload.github.com/adibender/coalitions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251352546,"owners_count":21575859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["coalition-probabilities","election-analysis","elections","r","rstats"],"created_at":"2024-08-13T07:06:15.835Z","updated_at":"2025-04-28T17:03:34.350Z","avatar_url":"https://github.com/adibender.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r options, echo=FALSE}\nlibrary(knitr)\nopts_chunk$set(warning=FALSE)\n```\n\n# coalitions \u003cimg src=\"man/figures/logo.png\" align=\"right\" /\u003e\n[![Travis-CI Build Status](https://travis-ci.org/adibender/coalitions.svg?branch=master)](https://travis-ci.org/adibender/coalitions)\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/adibender/coalitions?branch=master\u0026svg=true)](https://ci.appveyor.com/project/adibender/coalitions)\n[![Coverage Status](https://codecov.io/github/adibender/coalitions/master.svg)](https://codecov.io/github/adibender/coalitions?branch=master)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version-ago/coalitions)](https://cran.r-project.org/package=coalitions)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/coalitions)](https://cran.r-project.org/package=coalitions)\n[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\n\n## Overview\n\nThe `coalitions` package implements a Bayesian framework for the estimation of\nevent probabilities in multi-party electoral systems (Bauer et al., 2019) like Germany, Austria etc.\nTo support estimation, the package also implements scrappers that\nobtain data for German federal and general elections as well as Austrian\ngeneral election. The implementation can be extended to support other elections.\n\n  - To get started, see our [workflow vignette](https://adibender.github.io/coalitions/articles/workflow.html)\n\n  - Check out our [interactive shiny app](https://koala.stat.uni-muenchen.de/) on\n  German (state and federal) elections/surveys\n\n  - Updates are available from our [KOALA_LMU twitter account](https://twitter.com/KOALA_LMU)!\n\n## Installation\n\n```{r, eval=FALSE}\n# To install from CRAN use:\ninstall.packages(\"coalitions\")\n\n# To install the most current version from GitHub use:\ndevtools::install_github(\"adibender/coalitions\")\n```\n\n\n\n## Usage\n\nDetailed workflow is outlined in the\n[workflow](https://adibender.github.io/coalitions/articles/workflow.html)\nvignette.\n\nA short overview is presented below.\n\n\n### Scrape surveys\n\nThe wrapper `get_surveys()` which takes no arguments, downloads all surveys\ncurrently available at [wahlrecht](https://www.wahlrecht.de/umfragen) and\nstores them in a nested `tibble`:\n\n```{r, message = FALSE}\nlibrary(coalitions)\nlibrary(dplyr)\nlibrary(tidyr)\nsurveys \u003c- get_surveys()\nsurveys\n```\n\nEach row represents a polling agency and each row in the `surveys` column again\ncontains a nested `tibble` with survey results from different time-points:\n\n```{r}\nsurveys %\u003e%\n    filter(pollster == \"allensbach\") %\u003e%\n    unnest()\n\nsurvey \u003c- surveys %\u003e% unnest() %\u003e% slice(1)\nsurvey %\u003e% unnest()\n```\n\n### Calculate coalition probabilities\nFor each survey (row) we can calculate the coalition probabilities\n\n```{r}\nsurvey %\u003e% get_probabilities(nsim=1e4) %\u003e% unnest()\n```\n\n## References\nBauer, Alexander, Andreas Bender, André Klima, and Helmut Küchenhoff. 2019. “KOALA: A New Paradigm for Election Coverage.” AStA Advances in Statistical Analysis, June. https://doi.org/10.1007/s10182-019-00352-6.\n\nBender, Andreas, and Alexander Bauer. 2018. “Coalitions: Coalition Probabilities in Multi-Party Democracies,” March. https://doi.org/10.21105/joss.00606.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadibender%2Fcoalitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadibender%2Fcoalitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadibender%2Fcoalitions/lists"}