Miscellaneous analysis

Code
library(tidyverse)
library(scales)
library(sf)
library(tinytable)
library(targets)

tar_config_set(
  store = here::here("_targets"),
  script = here::here("_targets.R")
)

tar_load(c(map_with_data, action_state_type, action_treaty, action_non_derog))
invisible(list2env(tar_read(graphic_functions), .GlobalEnv))
invisible(list2env(tar_read(modelsummary_functions), .GlobalEnv))

Map of derogations

Code
ggplot() +
  geom_sf(
    data = map_with_data, aes(fill = derogations_1plus),
    linewidth = 0.1, color = "white"
  ) +
  coord_sf(crs = st_crs("+proj=robin"), datum = NA) +
  scale_fill_binned(low = colorspace::lighten(clrs[1], amount = 0.8),
    high = clrs[1], na.value = "grey85",
    breaks = c(1, 5, 10, 15, 20),
    limits = c(1, 20),
    name = "Derogations filed: ",
    guide = guide_colorsteps(barwidth = 7, barheight = 0.4, title.vjust = 1)
  ) +
  theme_pandem() +
  theme(
    panel.border = element_blank(),
    legend.title = element_text(face = "bold"),
    legend.text = element_text(size = rel(0.6)),
    legend.justification = "center"
  )

ICCPR pandemic-related derogations

Map of backsliding

Code
ggplot() +
  geom_sf(
    data = map_with_data, aes(fill = avg_panback_cut),
    linewidth = 0.05, color = "white"
  ) +
  coord_sf(crs = st_crs("+proj=robin"), datum = NA) +
  scale_fill_manual(
    values = clrs[c(8, 7, 2, 1)],
    na.value = "grey85",
    breaks = levels(map_with_data$avg_panback_cut),
    name = "Average Pandemic Backsliding Index"
  ) +
  theme_pandem() +
  theme(
    panel.border = element_blank(),
    legend.position = "bottom",
    legend.justification = "center"
  )

Average Pandemic Backsliding Index from V-Dem from March 2020–June 2021

Non-derogation treaty actions

Code
plot_action_state_type <- action_state_type |>
  select(State, Total = `Treaty Action Count`, Derogation, Other) |>
  pivot_longer(cols = -State, names_to = "type", values_to = "count") |>
  arrange(desc(type), desc(count)) |>
  mutate(State = fct_inorder(State))

panels <- plot_action_state_type |>
  filter(type == "Total") |>
  mutate(panel = ifelse(row_number() <= 21, 1, 2)) |>
  select(State, panel)

plot_action_state_type |>
  filter(type != "Total") |>
  left_join(panels, by = join_by(State)) |>
  ggplot(
    aes(x = count, y = fct_rev(State), fill = fct_rev(type))
  ) +
  geom_col() +
  scale_fill_manual(values = clrs[c(3, 6)], guide = guide_legend(reverse = TRUE)) +
  labs(x = "Total treaty actions between March 2020–June 2021", y = NULL, fill = NULL) +
  facet_wrap(vars(panel), scales = "free_y") +
  theme_pandem() +
  theme(strip.text = element_blank())

Counts of human rights treaty actions from March 2020–June 2021

Treaty actions by treaty

Code
action_treaty |>
  mutate(Treaty = fct_reorder(Treaty, `Number of Actions`)) |>
  group_by(`Number of Actions`) |>
  summarize(Treaties = str_flatten(Treaty, collapse = "; ")) |>
  ungroup() |>
  arrange(desc(`Number of Actions`)) |>
  tt(width = c(0.2, 0.8)) |>
  style_tt(j = 1:2, align = "l") |>
  style_tt(
    bootstrap_class = "table table-sm"
  )
Table 1
Number of Actions Treaties
111 ICCPR
8 CED
7 UN CRC Optional Protocol on the Involvement of Children in Conflict
3 CRPD OP; ICESCR OP
2 CAT; CRPD; ICCPR OP Abolition of Death Penalty; UN CRC Optional Protocol on the Sale of Chldren, Child Pornography, and Child Prostitution; UN CRC Optional Protocol Communications Procedure
1 CEDAW; CEDAW Amendment; CEDAW OP; CMW; Convention on the Non-Applicability of Statutory Limitations to War Crimes and Crimes Against Humanity; ICESCR; UN CRC
Code
action_treaty |>
  mutate(Treaty = fct_reorder(Treaty, `Number of Actions`)) |>
  mutate(panel = ifelse(row_number() >= 11, 1, 2)) |>
  ggplot(aes(x = `Number of Actions`, y = Treaty)) +
  geom_col(fill = clrs[5]) +
  scale_y_discrete(labels = label_wrap(35)) +
  labs(x = "Number of actions", y = NULL) +
  facet_wrap(vars(panel), scales = "free_y") +
  theme_pandem() +
  theme(strip.text = element_blank())

Non-derogation actions

Code
action_non_derog |>
  mutate(Action = fct_reorder(`Treaty Action`, Count)) |>
  ggplot(aes(x = Count, y = Action)) +
  geom_col(fill = clrs[3]) +
  labs(x = "Number of non-derogation actions", y = NULL) +
  theme_pandem()