Classification
Bormann, Nils-Christian, and Matt Golder. 2013. “Democratic Electoral Systems around the World, 1946–2011.” Electoral Studies 32(2): 360–69. — doi:10.1016/j.electstud.2013.01.005
library(DT)
library(sf)
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
library(tidyverse)
es_raw <- read_rds("source__es-data-v3.rds")
es <- es_raw
es_ctry <-
es %>%
filter(presidential == 0) %>%
group_by(country) %>%
mutate(
first = min(year),
last = max(year),
n = n()
) %>%
filter(row_number() == n()) %>%
ungroup() %>%
relocate(first, last, n, .after = country_name) %>%
relocate(elec_id, date, .after = last_col()) %>%
select(-presidential)
Maps
world <- read_rds("worldmap.rds")
pl_world <-
ggplot(data = world) +
geom_sf(size = 0.2) +
theme_void()
get_dt_table <- function(dt, var1, var2) {
dt %>%
as_tibble() %>%
filter(! is.na({{var2}})) %>%
count({{var1}}, {{var2}})
}
Electoral systems
# use `right_join()` to keep sf class and remove not convered countries
dt_map <-
world %>%
right_join(es_ctry) %>%
mutate(classification = paste(type_short, classification, sep = "-"))
pl_world +
geom_sf(data = dt_map, aes(fill = type_short), size = 0.2) +
coord_sf(crs = "+proj=robin") +
scale_fill_brewer(type = "qual", palette = 1)

pl_class <-
pl_world +
geom_sf(data = dt_map %>% filter(! str_detect(classification, "NA")),
aes(fill = classification), size = 0.2) +
coord_sf(crs = "+proj=robin") +
scale_fill_brewer(type = "qual", palette = 3)
print(pl_class)

ggsave("z-electoral-systems-map.png", pl_class)
get_dt_table(dt_map, legislative_type, classification)
Majoritarian types
pl_dt <- dt_map %>% filter(type_short == "Maj")
pl_world +
geom_sf(data = pl_dt, aes(fill = elecrule_short), size = 0.2) +
coord_sf(crs = "+proj=robin") +
scale_fill_brewer(type = "qual", palette = 7)

pl_dt %>%
as_tibble() %>%
count(classification, elecrule) %>%
arrange(-n)
Mixed types
pl_dt <- dt_map %>% filter(type_short == "Mix", ! is.na(mixed_type))
pl_world +
geom_sf(data = pl_dt, aes(fill = mixed_type), size = 0.2) +
coord_sf(crs = "+proj=robin") +
scale_fill_brewer(type = "qual", palette = 6)

get_dt_table(pl_dt, classification, mixed_type)
Regions
rule_region <-
es_ctry %>%
arrange(country) %>%
group_by(region3_short, type_short, classification) %>%
summarise(
n = n(),
countries = paste(str_to_title(country), collapse = ", "),
.groups = "drop"
) %>%
rename(region3 = region3_short, type = type_short)
rule_region %>% datatable()
Countries
Only last legislative election provided for each country.
es_ctry %>% datatable()
# write_csv(es_ctry, "es-data-v3-country_HD.csv")
LS0tCnRpdGxlOiAiRWxlY3RvcmFsIHN5c3RlbXMiCmF1dGhvcjogIkhvbGdlciBEb2VyaW5nIC0tLSBkb2VyaW5nQHVuaS1icmVtZW4uZGUiCmRhdGU6ICJgciBmb3JtYXQoU3lzLnRpbWUoKSwgJyVkICVCICVZJylgIgpvdXRwdXQ6CiAgaHRtbF9ub3RlYm9vazoKICAgIGNvZGVfZm9sZGluZzogaGlkZQogICAgdG9jOiB5ZXMKICAgIHRvY19mbG9hdDogeWVzCi0tLQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiA8IS0tIC50YWJsZSB7IHdpZHRoOiBhdXRvIH0gLS0tPiA8L3N0eWxlPgoKYGBge3Igb3B0aW9ucywgaW5jbHVkZT1GQUxTRX0Ka25pdHI6Om9wdHNfa25pdCRzZXQoCiAgIyByZXN1bHRzPSJoaWRlIiwKICBtZXNzYWdlPUZBTFNFLAogIHdhcm5pbmc9RkFMU0UsCiAgcGFja2FnZS5zdGFydHVwLm1lc3NhZ2UgPSBGQUxTRQogICkKCm9wdGlvbnMoCiAgcmVhZHIubnVtX2NvbHVtbnMgPSAwLAogIGtuaXRyLmthYmxlLk5BID0gIiIsCiAgd2lkdGggPSAxMDAsCiAgdGlkeXZlcnNlLnF1aWV0ID0gVFJVRQopCmBgYAoKPCEtLSA8cCBzdHlsZT0icGFnZS1icmVhay1iZWZvcmU6IGFsd2F5cyI+IC0tPgoKIyMgQ2xhc3NpZmljYXRpb24KCkJvcm1hbm4sIE5pbH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