Notes

Dieses Dokument beschreibt die Verarbeitung und Analyse der Daten, welche als Grundlage für den Artikel “Die SVP politisiert an der Basis vorbei”, welcher im Rahmen des Forschungsseminars Datenjournalismus an der UZH erstellt wurde. Die Verarbeitung und Analyse der Daten wurde in R-Studio und RMarkdown durchgeführt.

Dieser Bericht wurde am 2019-12-19 16:20:03 generiert. R-Version: 3.6.2.

Setup Markdown

# Setup
knitr::opts_chunk$set(collapse = TRUE)
knitr::opts_chunk$set(tidy = TRUE)
knitr::opts_chunk$set(echo = TRUE) 
knitr::opts_chunk$set(warning = FALSE) 
knitr::opts_chunk$set(message = FALSE) 
knitr::opts_chunk$set(fig.pos = 'H')

Load library

rm(list = ls())


# Library
library(tidyr)
library(plyr)
library(reshape2)
library(ggalt)
library(bbplot)
library(grDevices)
library(waffle)
library(extrafont)
library(magrittr)
library(hrbrthemes)
library(tidyverse)
library(ggwaffle)
library(gridExtra)
library(grid)
library(plotly)
library(dplyr)
library(kableExtra)
library(bsselectR)

Import data

Die Daten wurden von smartvote, sotomo und dem gfs Bern zur Verfügung gestellt.

# Import data
## smartvote data on the candidates for the 'National Council Elections 2019^
sv19 <- read.csv("smartvote_2019_nr.csv",
                 header = TRUE, sep = ";") 
## smartvote questionnaire 'National Council Elections 2019'
quest <- read.csv("FB_2019.csv",
                           header = TRUE, sep = ";")
## sotomo data on candidates for the 'National Council Elections 2019'
data <- read.csv("data.csv",
                           header = TRUE, sep = ";") # Parties
total <- read.csv("data_total.csv",
                           header = TRUE, sep = ";") # Total

Data Preparation

In einem ersten Schritt wurden einige Parteien umgruppiert. Die Antwortmöglichkeiten im smartvote-Fragebogen bestehen aus vier Kategorien: ‘Ja’, ‘eher Ja’, ‘eher Nein’ und ‘Nein’. Für die Analyse wurden diese in die Kategorien ‘Ja’ (Ja und eher Ja) und ‘Nein’ (Nein und eher Nein) umcodiert. Zudem wurden die unterschiedlichen Datensätze zusammengefügt & in die richtige Form gebracht.

# Prepare data
## smartvote data

### Reshuffle parties 
sv19$party_short[sv19$party_short=="ALG"] <- "Grüne"
sv19$party_short[sv19$party_short=="BastA!"] <- "Grüne"
sv19$party_short[sv19$party_short=="LDP"] <- "FDP"
sv19$party_short[sv19$party_short=="EVP"] <- "CVP"
sv19$party_short[sv19$party_short=="EDU"] <- "SVP"
sv19$party_short[sv19$party_short=="Lega"] <- "SVP"

### Filter member of parliament & parties of interest
sv19_r <- sv19 %>% 
  filter(elected == 1 & party_short %in% c("CVP", "FDP", "glp", "Grüne", "SP", "SVP"))

### drop unused levels
sv19_r$party_short = droplevels(sv19_r$party_short)

### Recode answers
sv19_r$name = paste(sv19_r$firstname, sv19_r$lastname, sep=" ") #Generate variable "name"
sv19_rr <- sv19_r %>%  
  select(name,
         party = party_short,
         rentenalter = answer_3412,
         einwanderung = answer_3428,
         steuern = answer_3436,
         gleichg.paare = answer_3432,
         kampfflugzeug = answer_3463,
         ) %>%  
  mutate_at(c(3:7), recode, `0` = 0, `25` = 0, `75` = 100, `100` = 100)

### Reshape data
sv19_rr <- melt(sv19_rr, id.vars = c("name", "party"))
colnames(sv19_rr) <- c("name", "party", "thema", "approval")

### Approval per party
sv19_pp <- sv19_rr %>% 
  group_by(party, thema) %>% 
  summarise_all(mean, na.rm = TRUE) %>%
  select(party, thema, approval) %>%
  mutate(rolle = "mp") %>%
  arrange(thema)

## Sotomo data
### Reshape data
data_r <- data %>% 
  gather(party, approval, SVP:SP) %>%
  select(party, frage, thema, approval, rolle)

## total
total_r <- total %>% 
  gather(party, approval, total) %>%
  select(party, frage, thema, approval, rolle) 

## Combinde data sets
data_n <- as.data.frame(rbind.fill(data_r, sv19_pp, total_r))

### Add missing questions
data_n$frage[data_n$thema == "rentenalter"] <- data$frage[data$thema == "rentenalter"]
data_n$frage[data_n$thema == "praemien"] <- data$frage[data$thema == "praemien"]
data_n$frage[data_n$thema == "klima"] <- data$frage[data$thema == "klima"]
data_n$frage[data_n$thema == "organspende"] <- data$frage[data$thema == "organspende"]
data_n$frage[data_n$thema == "einwanderung"] <- data$frage[data$thema == "einwanderung"]
data_n$frage[data_n$thema == "steuern"] <- data$frage[data$thema == "steuern"]
data_n$frage[data_n$thema == "gleichg.paare"] <- data$frage[data$thema == "gleichg.paare"]
data_n$frage[data_n$thema == "kampfflugzeug"] <- data$frage[data$thema == "kampfflugzeug"]

### Reshape new data set
data.final <- data_n %>% 
  spread(rolle, approval) %>% 
  mutate(diff = voter-mp) %>%
  arrange(thema, party) 

### Generate Variable "thema.neu"
data.final$thema.neu <- NA
data.final$thema.neu[data.final$thema == "rentenalter"] <- "Erhöhung Rentenalter"
data.final$thema.neu[data.final$thema == "praemien"] <- "Verbilligung der Krankenkassenprämien"
data.final$thema.neu[data.final$thema == "klima"] <- "Klimaschutzmassnahmen mit Kostenfolgen"
data.final$thema.neu[data.final$thema == "organspende"] <- "Organspende-Initiative"
data.final$thema.neu[data.final$thema == "einwanderung"] <- "Begrenzung der Einwanderung vs. Billaterale"
data.final$thema.neu[data.final$thema == "steuern"] <- "Steuersenkungen auf Bundesebene"
data.final$thema.neu[data.final$thema == "gleichg.paare"] <- "Gleiche Rechte für gleichgeschlechtliche Paare"
data.final$thema.neu[data.final$thema == "kampfflugzeug"] <- "Beschaffung neuer Kampfflugzeuge"
# Table Fragen
thema <- as.character(unique(data.final$thema.neu))
frage <- as.character(unique(data.final$frage))

table <- as.data.frame(cbind(thema, frage))
colnames(table) <- c("Thema", "Frage")
table %>%
  kable(row.names = F) %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), full_width = T, fixed_thead = T, font_size = 13)
Thema Frage
Begrenzung der Einwanderung vs. Billaterale Ist die Begrenzung der Einwanderung für Sie wichtiger als der Erhalt der Bilateralen Verträge mit der EU?
Gleiche Rechte für gleichgeschlechtliche Paare Sollen gleichgeschlechtliche Paare in allen Bereichen die gleichen Rechte wie heterosexuelle Paare haben?
Beschaffung neuer Kampfflugzeuge Befürworten Sie die Beschaffung neuer Kampfflugzeuge für die Schweizer Armee?
Klimaschutzmassnahmen mit Kostenfolgen Befürworten Sie Massnahmen zum Klimaschutz in der Schweiz mit Kostenfolgen, die im Alltag deutlich spürbar sind (Treibstoffabgabe, Gebäudevorschriften, Road-Pricing usw.)?
Organspende-Initiative Befürworten Sie die Organspende-Initiative?
Verbilligung der Krankenkassenprämien Sind Sie dafür, dass die Krankenkassenprämien auch für mittlere Einkommen mit Steuergeldern verbilligt werden?
Erhöhung Rentenalter Befürworten Sie eine Erhöhung des Rentenalters (z. B. auf 67 Jahre)?
Steuersenkungen auf Bundesebene Haben für Sie Steuersenkungen auf Bundesebene in den nächsten vier Jahren Priorität?

Visualizations

Gesamtübersicht
# Visualization 1: General overview per party
## Dumbbell chart: Overview total differences

### Prepare data
data.plot <- data.final %>%
  filter(party == "total") %>%
  mutate(abs.diff = abs(diff)) %>%
  arrange(-abs.diff) 

data.plot$diff.n <- c("+ 14", "- 12", "- 12", "+ 11", "+ 10", "- 05", "- 05", "- 04")

## Function for labelling percentage
percent <- function(x) {
  x <- sprintf("%d%%", round(x))
}

### Create basic plot
plot <- ggplot(data.plot, aes(x = mp, xend = voter, y = reorder(thema.neu, abs.diff), group = thema.neu)) +
  geom_dumbbell(colour = "#dddddd",
                size = 3,
                colour_x = "#FAAB18",
                colour_xend = "#35AEB2") +
  bbc_style() + 
  theme(axis.text.y = element_text(size=12),
        axis.text.x = element_text(size=12),
        plot.title = element_text(size=18),
        plot.subtitle = element_text(size=16))

### Add Labels
plot <- plot +
  geom_text(aes(x = mp, y = reorder(thema.neu, abs.diff)), label= percent(data.plot$mp), color = "#717D8C", size = 3.75, vjust = 2.5) +
  geom_text(aes(x = voter, y = reorder(thema.neu, abs.diff)), label= percent(data.plot$voter), color = "#717D8C", size = 3.75, vjust = 2.5, hjust = .75) 

### Add legend
plot <- plot +
  geom_text(data=filter(data.plot, thema=="praemien"), aes(x = mp, y = reorder(thema.neu, abs.diff)), label= "Parlamentarier/innen", color = "#FAAB18", size = 4, fontface = "bold", vjust = -2, hjust = .8) +
  geom_text(data=filter(data.plot, thema=="praemien"), aes(x = voter, y = reorder(thema.neu, abs.diff)), label= "Wähler/innen", color = "#35AEB2", size = 4, fontface = "bold", vjust = -2) 

### Add 'difference column'
plot <- plot +
  geom_rect(data=data.plot, 
            aes(xmin=103, xmax=113, ymin=-Inf, ymax=Inf), fill = "#dddddd") +
  geom_text(data=data.plot, 
            aes(label=diff.n, y=reorder(thema.neu, abs.diff), x=108),size=4) +
  geom_text(data=filter(data.plot, thema=="praemien"), 
                        aes(x=108, y=reorder(thema.neu, abs.diff), label="Differenz"),
                     size=3, vjust=-2.5, fontface="bold") +
  scale_x_continuous(expand=c(0,0), limits=c(0, 113)) +
  scale_y_discrete(expand=c(0.1,0)) 

### Add annotation
plot <- plot + 
  geom_label(aes(x = 20, y = 6.5, 
                 label = "Die grösste Differenz \nzeigt sich beim Thema \n'Krankenkassenprämien'"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "white", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) +
  geom_curve(aes(x = 25, y = 7.1, xend = 40, yend = 8), 
                             colour = "#555555", 
                             size=0.1, 
                             curvature = -0.3,
                             arrow = arrow(length = unit(0.02, "npc")))
# Plot 
plot

Verteilung Parlament & Wählerschaft
approval <- c(rep(100, round(184/100*53))) #53 = 53% 
rejection <- c(rep(100, round(184/100*(100-56))))    
party <- "total"

#### Ja
voter_ja <- as.data.frame(cbind(approval, party))
voter_ja <- waffle_iron(voter_ja, aes_d(group = party), rows = 5)
voter_ja$group <- "Wähler/Innen"
voter_ja$answer <- "Ja"
voter_ja$rolle <- "voter"
voter_ja$name <- "Wähler/innen"

#### Nein
voter_nein <- as.data.frame(cbind(rejection, party))
voter_nein <- waffle_iron(voter_nein, aes_d(group = party), rows = 5)
voter_nein$group <- "Wähler/Innen"
voter_nein$answer <- "Nein"
voter_nein$rolle <- "voter"
voter_nein$name <- "Wähler/innen"

#### Approval data in waffle format
##### Yes
mp.ja <- sv19_rr %>%
  filter(thema == "kampfflugzeug" & approval == "100") %>%
  select(approval, name, party) %>%
  arrange(party) %>%
  na.omit() 

mp.ja$party <- as.character(mp.ja$party)
waffle_ja <- waffle_iron(mp.ja, aes_d(group = party), rows = 5)
waffle_ja$group <- factor(waffle_ja$group, levels = c("CVP", "FDP", "glp", "Grüne", "SP", "SVP"))
waffle_ja$answer <- "Ja"
waffle_ja$name <- as.character(mp.ja$name)
waffle_ja$rolle <- "mp"

##### No
mp.nein <- sv19_rr %>%
  filter(thema == "kampfflugzeug" & approval == "0") %>%
  select(approval, name, party) %>%
  arrange(party) %>%
  na.omit() 

mp.nein$party <- as.character(mp.nein$party)

waffle_nein <- waffle_iron(mp.nein, aes_d(group = party), rows = 5)
waffle_nein$group <- factor(waffle_nein$group, levels = c("CVP", "FDP", "glp", "Grüne", "SP", "SVP"))
waffle_nein$answer <- "Nein"
waffle_nein$name <- as.character(mp.nein$name)
waffle_nein$rolle <- "mp"

##### Combinde data frames
waffle <- rbind(waffle_ja, waffle_nein, voter_ja, voter_nein)

#### New facet label names 
waffle$rolle <- factor(waffle$rolle, 
                         labels = c("Parlamentarier/Innen", "Wähler/Innen"))
waffle$name[waffle$rolle == "Wähler/Innen"] <- "Wähler/Innen"

#### Approval rate
app.mp <- percent(data.final$mp[data.final$thema == "kampfflugzeug" & data.final$party == "total"])
rej.mp <- percent(100-data.final$mp[data.final$thema == "kampfflugzeug" & data.final$party == "total"])
app.voter <- percent(data.final$voter[data.final$thema == "kampfflugzeug" & data.final$party == "total"])
rej.voter <- percent(100-data.final$voter[data.final$thema == "kampfflugzeug" & data.final$party == "total"])

waffle$rate <- NA
waffle$rate[waffle$rolle == "Parlamentarier/Innen" & waffle$answer == "Ja"] <- app.mp
waffle$rate[waffle$rolle == "Parlamentarier/Innen" & waffle$answer == "Nein"] <- rej.mp
waffle$rate[waffle$rolle == "Wähler/Innen" & waffle$answer == "Ja"] <- app.voter
waffle$rate[waffle$rolle == "Wähler/Innen" & waffle$answer == "Nein"] <- rej.voter

### Create basic plot
plot.new <-ggplot(waffle, aes(x, y, fill = group, text = paste("Name: ", name)), label = rate) + 
  geom_tile(color = "white", size = 2) + 
  scale_fill_manual(
    name = "",
    values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
               "SP" = "#dd0e0e", "SVP" = "#0a7228", "Wähler/Innen" = "#35AEB2", "Nein" = "#7a7d7e"),
    labels = function(x) paste0(" ", x, "  ")) + 
  facet_grid(rolle ~ answer) +
  labs(x = NULL, y = NULL) +
  coord_equal() +
  bbc_style() +
  theme_minimal() +
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank(),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.background = element_blank(),
        plot.title = element_text(size=16, family="Helvetica"),
        plot.subtitle = element_text(size=14, family="Helvetica"),
        legend.text=element_text(size=18),
        legend.title = element_text(size = 8, face="bold"),
        strip.text.x = element_text(size = 18, color = "#7a7d7e", face = "bold"),
        strip.text.y = element_blank()) 


### Add 'percentage column'
plot.new <- plot.new +
  geom_rect(data=waffle, 
            aes(xmin=-2, xmax=0.1, ymin=0.5, ymax=5.5), fill = "#efefe3") + 
  geom_text(data = waffle, mapping = aes(x = -0.95, y = 3, label = rate), size = 5)

### Add annotation
d.anno <- ddply(.data=waffle, 
                 .(rolle, answer), 
                 summarize, 
                 n=paste("Wähler/innen"))
d.anno[2,3] <- ""
d.anno[4,3] <- ""
d.anno[1,3] <- "Parlament"

plot.new <- plot.new + 
          geom_text(data=d.anno, aes(x=-3, y=3, label=n), 
                    colour="#555555", family = "Helvetica", size = 5.5, inherit.aes=FALSE, parse=FALSE,
                    angle = 90) 
# Plot Neu
plot.new

Einzelne Fragen

# Visualization Klima
### Prepare data
data.plot1 <- data.final %>%
  filter(thema == "klima" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot1$diff.n <- c("- 21", "- 31", "- 15", "- 08", "- 20", "+ 10")

## Bar chart: Grouped lollipop chart
plot1 <- ggplot(data.plot1, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot1$approval), group = rolle), 
            position = position_dodge(0.5),
            vjust = -1.5, hjust = 0.5, size = 4, color = "black", family = "Helvetica", face = "bold") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot1 <- plot1 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot1,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot1, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot1, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot1, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot1, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot1, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot1, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot1 <- plot1 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

### Add legend
plot1 <- plot1 +
  geom_text(data=filter(data.plot1, party == "CVP" & rolle == "mp"), aes(x = party, y = approval, group = rolle), label= "Parlamentarier/innen", color = "#ff9100", alpha = .5,size = 3.5, fontface = "bold", vjust = -4) +
   geom_text(data=filter(data.plot1, party == "CVP" & rolle == "voter"), aes(x = party, y = approval, group = rolle), label= "Wähler/innen", color = "#ff9100", size = 3.5, fontface = "bold", vjust = -4,
             hjust = -0.01)
plot1

ggsave(plot1, file="plots/drei.png", width = 11, height = 7)
# Visualization Pramien
### Prepare data
data.plot2 <- data.final %>%
  filter(thema == "praemien" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot2$diff.n <- c("+ 56", "+ 38", "+ 28", "- 36", "- 31", "+ 41")

## Bar chart: Grouped lollipop chart
plot2 <- ggplot(data.plot2, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot2$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -1.5, hjust = 0.5, size = 4, color = "black", family = "Helvetica", face = "bold") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot2 <- plot2 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot2,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot2, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot2, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot2, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot2, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot2, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot2, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot2 <- plot2 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

### Add legend
plot2 <- plot2 +
  geom_text(data=filter(data.plot2, party == "CVP" & rolle == "mp"), aes(x = party, y = approval, group = rolle), label= "Parlamentarier/\n-innen", color = "#ff9100", alpha = .5,size = 3.5, fontface = "bold", vjust = -1.5, hjust = 1) +
   geom_text(data=filter(data.plot2, party == "CVP" & rolle == "voter"), aes(x = party, y = approval, group = rolle), label= "Wähler/innen", color = "#ff9100", size = 3.5, fontface = "bold", vjust = -4)
# Plot
plot2

# Table Fragen
Differenz <- c(22.63, 27.42, 17.63, 18.16,  18.37, 24.10, 9.13)
table2 <- as.data.frame(t(Differenz))
colnames(table2) <- c("CVP","FDP","glp","Grüne","SP","SVP","Total")

table2 %>%
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), full_width = T, fixed_thead = T, font_size = 13)
CVP FDP glp Grüne SP SVP Total
22.63 27.42 17.63 18.16 18.37 24.1 9.13
# Visualization 3
### Prepare data
data.plot3 <- data.final %>%
  filter(thema == "einwanderung" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot3$diff.n <- c("+24", "+ 31", "+ 11", "+ 12", "+ 09 ", "- 04")

## Bar chart: Grouped lollipop chart
plot3 <- ggplot(data.plot3, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                     "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot3$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nIst die Begrenzung der Einwanderung für Sie wichtiger \nals der Erhalt der Bilateralen Verträge mit der EU?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom"
        ) +
  ylim(0,119)

### Add 'difference row'
plot3 <- plot3 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot3,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot3, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
    geom_rect(data=data.plot3, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
    geom_rect(data=data.plot3, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
    geom_rect(data=data.plot3, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
    geom_rect(data=data.plot3, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
    geom_text(data=data.plot3, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot3 <- plot3 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 4
### Prepare data
data.plot4 <- data.final %>%
  filter(thema == "gleichg.paare" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot4$diff.n <- c("+ 12", "- 30", "- 13", "- 09", "- 09", "+ 07")

## Bar chart: Grouped lollipop chart
plot4 <- ggplot(data.plot4, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot4$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nSollen gleichgeschlechtliche Paare in allen Bereichen \ndie gleichen Rechte wie heterosexuelle Paare haben?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot4 <- plot4 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot4,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot4, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot4, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot4, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot4, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot4, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot4, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot4 <- plot4 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 


# Visualization 5
### Prepare data
data.plot5 <- data.final %>%
  filter(thema == "kampfflugzeug" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot5$diff.n <- c("- 35", "- 30", "- 29", "+ 18", "+ 19", "- 25")

## Bar chart: Grouped lollipop chart
plot5 <- ggplot(data.plot5, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot5$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nBefürworten Sie die Beschaffung neuer Kampfflugzeuge \nfür die Schweizer Armee?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot5 <- plot5 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot5,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot5, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot5, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot5, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot5, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot5, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot5, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot5 <- plot5 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 6
### Prepare data
data.plot6 <- data.final %>%
  filter(thema == "klima" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot6$diff.n <- c("- 21", "- 31", "- 15", "- 08", "- 20", "+ 10")

## Bar chart: Grouped lollipop chart
plot6 <- ggplot(data.plot6, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot6$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nBefürworten Sie Massnahmen zum Klimaschutz mit Kostenfolgen, \ndie im Alltag deutlich spürbar sind?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot6 <- plot6 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot6,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot6, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot6, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot6, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot6, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot6, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot6, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot6 <- plot6 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 7
### Prepare data
data.plot7 <- data.final %>%
  filter(thema == "organspende" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot7$diff.n <- c("+ 31", "- 01", "+ 05", "- 04", "+ 08", "+ 36")

## Bar chart: Grouped lollipop chart
plot7 <- ggplot(data.plot7, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot7$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nBefürworten Sie die Organspende-Initiative?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot7 <- plot7 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot7,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot7, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot7, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot7, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot7, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot7, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot7, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot7 <- plot7 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 8
### Prepare data
data.plot8 <- data.final %>%
  filter(thema == "praemien" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot8$diff.n <- c("+ 56", "+ 38", "+ 28", "- 36", "- 31", "+ 41")

## Bar chart: Grouped lollipop chart
plot8 <- ggplot(data.plot8, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot8$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nSind Sie dafür, dass die Krankenkassenprämien auch für \nmittlere Einkommen mit Steuergeldern verbilligt werden?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot8 <- plot8 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot8,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot8, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot8, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot8, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot8, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot8, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot8, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot8 <- plot8 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 9
### Prepare data
data.plot9 <- data.final %>%
  filter(thema == "rentenalter" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot9$diff.n <- c("+ 03", "- 27", "- 29", "+ 34", "+ 26", "- 25")

## Bar chart: Grouped lollipop chart
plot9 <- ggplot(data.plot9, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot9$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nBefürworten Sie eine Erhöhung des Rentenalters (z. B. auf 67 Jahre)?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot9 <- plot9 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot9,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot9, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot9, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot9, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot9, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot9, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot9, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot9 <- plot9 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4) 

# Visualization 10
### Prepare data
data.plot10 <- data.final %>%
  filter(thema == "steuern" & party != "total") %>%
  gather(voter, approval, -party, -frage, -thema, -thema.neu, -diff) %>%
  select(rolle = voter, approval, party, frage, thema, thema.neu, diff)

data.plot10$diff.n <- c("+ 01", "- 22", "- 11", "+ 24", "+ 25", "- 34")

## Bar chart: Grouped lollipop chart
plot10 <- ggplot(data.plot10, aes(party, approval)) +
  geom_linerange(
    aes(x = party, ymin = 0, ymax = approval, group = rolle), 
    color = "lightgray", size = 1.5,
    position = position_dodge(0.3))+
  geom_point(
    aes(color = party, group = rolle, alpha = rolle),
    position = position_dodge(0.3), size = 7) +
  bbc_style() +
  scale_color_manual(values = c("CVP" = "#ff9100", "FDP" = "#3a8bc1", "glp" = "#a0a000", "Grüne" = "#66cc00", 
                                "SP" = "#dd0e0e", "SVP" = "#0a7228"),
                     guide = F) +
  scale_alpha_discrete(range = c(0.5, 1),
                       labels = c("Parlamentarier/Innen", "Wähler/Innen")) +
  geom_text(aes(label = percent(data.plot10$approval), group = rolle), 
            position = position_dodge(0.3),
            vjust = -2, hjust = 0.5, size = 3, color = "black", family = "Helvetica", face = "bold") +
  labs(title="\nHaben für Sie Steuersenkungen auf Bundesebene \nin den nächsten vier Jahren Priorität?",
       subtitle = "Zustimmung, in %") +
  theme(axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=10),
        plot.title = element_text(size=14,  family="Helvetica"),
        plot.subtitle = element_text(size=12, family="Helvetica"),
        legend.text=element_text(size=10),
        legend.position = "bottom") +
  ylim(0,119)


### Add 'difference row'
plot10 <- plot10 +
  scale_y_continuous(expand=c(0,25), limits=c(0, 125), breaks = seq(0,100,25)) +
  geom_rect(data=data.plot10,
            aes(xmin=0.5, xmax=1.5, ymin=110, ymax=125), fill = "#ff9100") +
  geom_rect(data=data.plot10, 
            aes(xmin=1.5, xmax=2.5, ymin=110, ymax=125), fill = "#3a8bc1") +
  geom_rect(data=data.plot10, 
            aes(xmin=2.5, xmax=3.5, ymin=110, ymax=125), fill = "#a0a000") +
  geom_rect(data=data.plot10, 
            aes(xmin=3.5, xmax=4.5, ymin=110, ymax=125), fill = "#66cc00") +
  geom_rect(data=data.plot10, 
            aes(xmin=4.5, xmax=5.5, ymin=110, ymax=125), fill = "#dd0e0e") +
  geom_rect(data=data.plot10, 
            aes(xmin=5.5, xmax=6.5, ymin=110, ymax=125), fill = "#0a7228") +
  geom_text(data=data.plot10, 
            aes(label=diff.n, x=party, y=117.5), size=5, color = "white") 


### Add annotation
plot10 <- plot10 + 
  geom_label(aes(x = -0.1, y = 117.5, 
                 label = "Differenz"), 
             lineheight = 1.2,
             hjust = 0,
             vjust = 0.5,
             colour = "#555555", 
             fill = "transparent", 
             label.size = NA, 
             family="Helvetica", 
             size = 4)