Norway Storting Valg
Preliminary Results
Election Date: 13 Sept,2021
Analysis Date: 14 Sept,2021
- Loading Libraries
library(readxl) # for reading excel file
library(tidyverse) # for data wrangling
library(ggplot2) # for plotting
library(ggparliament) # for parliament plot
library(dplyr) # for pipes
library(DT) # DT Tables
library(kableExtra) # Table Styling
- Read excel file
# read_excel("...")
- Arbeiderpartiet got the most seats: 48
Valg %>% kbl() %>% kable_styling()
year | country | house | party_long | party_short | seats | government | colour |
---|---|---|---|---|---|---|---|
2021 | Norway | Storting | Arbeiderpartiet | AP | 48 | 0 | #df1a21 |
2021 | Norway | Storting | Hoyre | H | 36 | 0 | #87acd7 |
2021 | Norway | Storting | Senterpartiet | Sp | 28 | 0 | #217121 |
2021 | Norway | Storting | Fremskrittspartiet | Frp | 21 | 0 | #005194 |
2021 | Norway | Storting | Sosialistisk Venstreparti | SV | 13 | 0 | #a51818 |
2021 | Norway | Storting | Rodt | R | 8 | 0 | #e73446 |
2021 | Norway | Storting | Venstre | V | 8 | 0 | #53be29 |
2021 | Norway | Storting | Kristeliq Folkeparti | KrF | 3 | 0 | #ffaf10 |
2021 | Norway | Storting | Miljopartiet De Gronne | MdG | 3 | 0 | #67962e |
2021 | Norway | Storting | Pasientfokus | Other | 1 | 0 | #2d3326 |
- Take data and transform for ggparliament
No_Valg <- parliament_data(election_data = Valg,
type = "semicircle",
parl_rows = 4,
party_seats = Valg$seats)
- Plotting the data.
ggplot(No_Valg, aes(x, y, colour = party_long)) +
geom_parliament_seats() +
geom_highlight_government(government == 1) +
# add bar showing proportion of seats by party in legislature
geom_parliament_bar(colour = colour, party = party_long) +
theme(legend.position = 'bottom'
) +
labs(colour = NULL,
title = "Norway Storting Valg 2021",
subtitle = "Preliminary results") +
scale_colour_manual(values = No_Valg$colour,
limits = No_Valg$party_long)
The files and links can be found on github Repo:
https://github.com/daniyalarif/Reporting_Analytics/tree/main/StortingValg