Opinion polls for the 2021 German elections
The Guardian newspaper has an election poll tracker for the upcoming German election. The list of the opinion polls since Jan 2021 was found on Wikipedia. My challenge was to reproduce the graph as closely as possible.
I used the ‘dplyr’ and ‘ggplot’ packages to reproduce the graph. The final output can be found below:
german_election_polls %>% select(union,spd,af_d, fdp, linke, grune, end_date)%>%
pivot_longer(.,cols= c(union,spd,af_d,fdp,linke,grune),
names_to = "Political_Parties",values_to = "val") %>%
ggplot(aes(x= end_date, y= val, fill= Political_Parties,
colour= Political_Parties))+
geom_point(alpha=0.5)+
geom_smooth(se=FALSE)+
scale_y_continuous(labels=function(x) paste0(x,"%"))+
scale_x_date(date_labels = "%b %y")+
xlab("Date")+
ylab("Percentage of votes")+
labs(title= "German Election Polls 2021")+
scale_color_manual(values=c("#0099FF", "#FFFF00", "#339933", "#CC0099",
"#FF3300", "#000000"))+
theme(plot.title=element_text(hjust=0.5))+
knitr::opts_chunk$set(fig.width=unit(10,"cm"), fig.height=unit(10,"cm"))

From the reproduced graph, we can clearly see the upcoming trends for the German elections. It is particularly interesting how the union party has dropped massively in popularity between January 2021 until today, from about 38% of voters to under 20% as of today. This comes in contrast to the SPD who whilst its poll projections remained at about 15% for most of the year, in July 2021 this percentage flew to about 25%, in a very short amount of time. The Green party has also one of the highest percentage of votes but in the past 5 months it has been experiencing a fall in percentages with about 16% of voters reporting to support the Greens today. The battle for who is going to take lead into the German election is one of great interest as the potential of different parties working together brings large implications on the future of the country, but also Europe.