gg_survey {coalitions} | R Documentation |
Plot voter shares observed in one survey
Description
Bar chart of the raw voter shares observed in one survey. Additionally to plotting positive voter shares, the function can be used to plot party-specific differences (e.g. between a survey and the election result), including negative numbers.
Usage
gg_survey(data, colors = NULL, labels = NULL, annotate_bars = TRUE, hurdle = 5)
Arguments
data |
Scraped dataset containing one row per party in the column
|
colors |
Named vector containing party colors. If |
labels |
Named vector containing party labels. If |
annotate_bars |
If |
hurdle |
Hurdle for single parties to get into the parliament, e.g. '5'
for '5%'. If set to NULL no horizontal line is plotted.
The horizontal line can be suppressed using |
Examples
library(tidyr)
library(dplyr)
library(coalitions)
survey <- surveys_sample$surveys[[1]]$survey[[1]]
gg_survey(survey)