gg_survey | R Documentation |
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.
gg_survey(data, colors = NULL, labels = NULL, annotate_bars = TRUE, hurdle = 5)
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 |
library(tidyr)
library(dplyr)
library(coalitions)
survey <- surveys_sample$surveys[[1]]$survey[[1]]
gg_survey(survey)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.