2020 - Tableau des entrées-sorties (38 branches) - TES_38_2020

Données - INSEE

Tableau des entrées-sorties : pour chaque produit, ressources (production intérieure + importations) et emplois (consommations intermédiaires par branche, consommation finale, FBCF, exportations). Version à 38 branches, année 2020.

Structure

Ressources par produit (2020)

Code
TES |>
  filter(year == this_y, col_label %in% c(prod_col, imp_col), code != "TOTAL") |>
  mutate(poste = ifelse(col_label == prod_col, "Production intérieure", "Importations")) |>
  ggplot() + theme_minimal() + xlab("") + ylab("Mds €") +
  geom_col(aes(x = reorder(str_trunc(label, 34), value), y = value, fill = poste)) +
  scale_fill_manual(values = viridis(2)) + coord_flip() +
  theme(legend.title = element_blank(), legend.position = "bottom",
        axis.text.y = element_text(size = 7))

Taux de pénétration des importations (2020)

Code
TES |>
  filter(year == this_y, col_label %in% c(prod_col, imp_col), code != "TOTAL") |>
  select(label, col_label, value) |>
  mutate(col_label = ifelse(col_label == prod_col, "prod", "imp")) |>
  tidyr::pivot_wider(names_from = col_label, values_from = value, values_fn = sum) |>
  filter(prod + imp > 0) |>
  ggplot() + theme_minimal() + xlab("") + ylab("Importations / (production + importations)") +
  geom_col(aes(x = reorder(str_trunc(label, 34), imp / (prod + imp)), y = imp / (prod + imp)),
           fill = "#2b6cb0") +
  coord_flip() + scale_y_continuous(labels = percent_format(accuracy = 1)) +
  theme(axis.text.y = element_text(size = 7))

Matrice des consommations intermédiaires (2020)

Code
brc <- TES |> filter(year == this_y, grepl("^([A-Z]{2}|C[0-9])$", col_label)) |> distinct(col_label) |> pull()
TES |>
  filter(year == this_y, col_label %in% brc, code != "TOTAL", !is.na(value)) |>
  ggplot(aes(a17_label(col_label), reorder(str_trunc(label, 30), value), fill = value)) +
  geom_tile(color = "white", linewidth = 0.1) +
  scale_fill_viridis_c(trans = "pseudo_log", labels = comma_format()) +
  theme_minimal() + xlab("Branche consommatrice") + ylab("Produit") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 6.5),
        axis.text.y = element_text(size = 6.5), legend.position = "none")

Table (2020)

Code
TES |> filter(year == this_y) |>
  transmute(Produit = str_trunc(label, 45), Colonne = col_label, value = round(value, 1)) %>%
  {if (is_html_output()) datatable(., filter = "top", rownames = F) else head(., 80)}