~/data/ipp/

Liste

i_g("bib/ipp/prestations-sociales.png")

RMI

Table

rmi_m %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  ggplot() + geom_line(aes(x = date, y = value)) +
  scale_color_manual(values = viridis(8)[1:7]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI en euros") + xlab("")

RSA

Table

rsa_m %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  ggplot() + geom_line(aes(x = date, y = value)) +
  scale_color_manual(values = viridis(8)[1:7]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RSA en euros") + xlab("")

RMI / RSA

Table

rsa_m %>%
  bind_rows(rmi_m) %>%
  select(date, montant_base_rsa, 
         montant_base_rmi, date_parution_jo) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

Valeur

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1992)") + xlab("")

1992

Valeur

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1992-01-01")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1992-01-01")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1992)") + xlab("")

1996

Valeur

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1996-01-01")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100 (+53%)

rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1996-01-01")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1996)") + xlab("")