briatte / repere2024

REPERE 2024 research project
0 stars 0 forks source link

REPERE 2024

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.

Contents

data-cities

City-level data:

data-elections

Electoral data, scraped from the Web archive of the Ministry of the Interior:

data-lists

Data from the 2024 electoral lists:

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:

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:

Dependencies

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)

HOWTO

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")