The code and data in this repo are part of the REPERE (Recherche Empirique sur la Participation Électorale des Ressortissants Européens) and ECREMEE research projects. The repo focuses on the département du Nord and the EU elections of 2024.
See Kelbel et al. 2024 for earlier results on the 2020 municipal elections.
data-cities
City-level data:
border
-- contiguity to Belgian border
border.tsv
dataset contains some of the same information, with minor corrections.census
-- population characteristics extracted from the 2021 census
density
-- population density, continuous and categorical
geography
-- spatial boundaries and centroids
population
-- legal population sizes
data-elections
Electoral data, scraped from the Web archive of the Ministry of the Interior:
eur-2024
-- turnout in the 2024 EU electionsmun-2020
-- turnout in the 2020 municipal elections
pre-2024
-- turnout and results of the 2022 presidential electiondata-lists
Data from the 2024 electoral lists:
councillors
-- non-French voters on municipal councils
coverage
-- data collection coverage
electorate
-- registered voters
electorate-.*.rds
files, as well as electorate-counts.tsv
, as well as any script that produces anything based on these datasets, e.g. electorate.md
, panel.rds
and panel.rmd
, councillors.tsv
, and so on.panel
-- find voters observed in both 2020 and 2024
vote2024
-- observed voting patterns
N.B. The scripts in this folder rely on several restricted-access datasets that contain personal information on voters. In all published material, personal information is replaced with pid
128-bit hashes based on family names, first names (replaced with "NA" when missing) and dates of birth (also replaced with "NA" when missing, which occurs only in the 2020 sample).
data-nationalities
Data on non-French EU nationalities, at the national and departmental levels:
nationalities
-- counts of top 8 non-French EU nationalities (source: census, 2021)N.B. The counts and proportions for "Other EU" nationalities is an approximation for each other EU nationality, obtained by dividing the total number of "Other EU" nationals by 18 (EU 27 - French - top 8 non-French nationalities).
plot-cartograms
Contiguous and non-overlapping circle cartograms of abstention and turnout rates.
Example:
plot-choropleths
Maps of electorate sizes in the 2024 EU elections.
Example:
plot-turnout
Scatterplots of turnout in the 2024 EU elections vs. previous years:
plot-turnout
Scatterplots of vote shares in the 2024 EU elections vs. the 2022 presidential election.
Example:
library(tidyverse)
fs::dir_ls(glob = "*r", recurse = TRUE) %>%
map(read_lines) %>%
map(str_subset, "library\\(") %>%
unlist() %>%
unique() %>%
sort() %>%
cat(sep = "\n")
library(cartogram)
library(ggrepel)
library(jqr)
library(patchwork)
library(rvest) # bundled with the {tidyverse}
library(sf)
library(tidyverse)
The code below will refresh all datasets, plots and reports.
# fs::dir_ls(glob = "*r", recurse = TRUE)
# [1] generate datasets
# city-{centres,contours}.rds
source("data-cities/geography/geography.r")
# population.tsv
source("data-cities/population/population.r")
# turnout-eur-2024.tsv
source("data-elections/eur-2024/eur-2024.r")
# results-eur-2024.tsv
source("data-elections/eur-2024/results-eur-2024.r")
# turnout-mun-2020-r[12].tsv
source("data-elections/mun-2020/mun-2020.r")
# turnout-pre-2022-r[12], results-pre-2022-r[12].tsv
source("data-elections/pre-2022/pre-2022.r")
# vshares-pre-2022.tsv
source("data-elections/pre-2022/vshares-pre-2022.r")
# coverage.tsv
source("data-lists/coverage/coverage.r")
# electorate-{eur,mun,ppl}.rds, electorate-counts.tsv
source("data-lists/electorate/electorate.r")
# panel.tsv
source("data-lists/panel/panel.r")
# [2] generate plots
source("data-lists/coverage/plot-coverage.r")
source("plot-cartograms/plot-cartograms.r")
source("plot-choropleths/plot-choropleths.r")
source("plot-turnout/plot-turnout.r")
source("plot-vshares/plot-vshares.r")
# [3] generate reports
library(knitr)
# coverage.md
knitr::knit("data-lists/coverage.rmd")