Comptes des branches

Data - Insee

Info

source dataset .html .RData
insee CNT-2014-CB 2024-12-22 2024-12-22

Données sur la macroéconomie en France

source dataset .html .RData
bdf CFT 2024-12-22 2024-12-09
insee CNA-2014-CONSO-SI 2024-12-22 2024-12-22
insee CNA-2014-CSI 2024-12-22 2024-12-22
insee CNA-2014-FBCF-BRANCHE 2024-12-22 2024-12-22
insee CNA-2014-FBCF-SI 2024-06-07 2024-12-22
insee CNA-2014-RDB 2024-12-22 2024-12-22
insee CNA-2020-CONSO-MEN 2024-12-22 2024-09-12
insee CNA-2020-PIB 2024-12-22 2024-09-11
insee CNT-2014-CB 2024-12-22 2024-12-22
insee CNT-2014-CSI 2024-12-22 2024-12-22
insee CNT-2014-OPERATIONS 2024-12-16 2024-12-22
insee CNT-2014-PIB-EQB-RF 2024-12-22 2024-12-22
insee CONSO-MENAGES-2020 2024-11-22 2024-12-22
insee conso-mensuelle 2024-06-07 2023-07-04
insee ICA-2015-IND-CONS 2024-12-22 2024-12-22
insee t_1101 2024-11-22 2022-01-02
insee t_1102 2024-11-22 2020-10-30
insee t_1105 2024-11-22 2020-10-30

LAST_UPDATE

Code
`CNT-2014-CB` %>%
  group_by(LAST_UPDATE) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(LAST_UPDATE)) %>%
  print_table_conditional()
LAST_UPDATE Nobs
2024-04-30 178344

LAST_COMPILE

LAST_COMPILE
2024-12-22

Last

Code
`CNT-2014-CB` %>%
  group_by(TIME_PERIOD) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(TIME_PERIOD)) %>%
  head(2) %>%
  print_table_conditional()
TIME_PERIOD Nobs
2024-Q1 144
2023-Q4 594
  • Le compte de production décrit la relation entre la production et la consommation intermédiaire nécessaire à cette production. Il a pour solde la valeur ajoutée brute qui mesure la richesse créée lors du processus de production.

  • Le compte d’exploitation décrit comment la valeur ajoutée brute couvre la rémunération versée aux salariés et les impôts sur la production. Il a pour solde l’excédent brut d’exploitation et le revenu mixte brut qui mesurent le profit d’exploitation des branches.

TITLE_FR

Code
`CNT-2014-CB` %>%
  group_by(IDBANK, TITLE_FR) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

INDICATEUR

Code
`CNT-2014-CB` %>%
  left_join(INDICATEUR,  by = "INDICATEUR") %>%
  group_by(INDICATEUR, Indicateur) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
INDICATEUR Indicateur Nobs
CNT-COMPTE_EXPLOITATION_BRANCHES Compte d'exploitation des branches 63000
CNT-COMPTE_PRODUCTION_BRANCHES Compte de production des branches 43344
CNT-EMPLOI_INTERIEUR_BRANCHES Emploi intérieur par branche 43200
CNT-DUREE_VOLUME_TRAVAIL_BRANCHE Durée hebdomadaire et volume de travail par branche 28800

VALORISATION

Code
`CNT-2014-CB` %>%
  left_join(VALORISATION,  by = "VALORISATION") %>%
  group_by(VALORISATION, Valorisation) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
VALORISATION Valorisation Nobs
SO Sans objet 135000
L Volumes aux prix de l'année précédente chaînés 21672
V Valeurs aux prix courants 21672

OPERATION

Code
`CNT-2014-CB` %>%
  left_join(OPERATION,  by = "OPERATION") %>%
  group_by(OPERATION, Operation) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

UNIT_MEASURE

Code
`CNT-2014-CB` %>%
  group_by(UNIT_MEASURE) %>%
  summarise(Nobs = n()) %>%
  {if (is_html_output()) print_table(.) else .}
UNIT_MEASURE Nobs
ETP 21600
EUROS 106344
HEURES 28800
INDIVIDUS 21600

CNA_PRODUIT

Code
`CNT-2014-CB` %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  group_by(CNA_PRODUIT, Cna_produit) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

TIME_PERIOD

Code
`CNT-2014-CB` %>%
  group_by(TIME_PERIOD) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(TIME_PERIOD)) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Excédent Brut / PIB par branche

All

Code
`CNT-2014-CB` %>%
  filter(TIME_PERIOD %in%  c("2022-Q4", "2019-Q4", "2006-Q4")) %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         VALORISATION %in% c("V", "SO")) %>%
  quarter_to_date() %>%
  select(date, OPERATION, CNA_PRODUIT, OBS_VALUE) %>%
  left_join(gdp_quarterly, by = "date") %>%
  mutate(B2_gdp = round(100*OBS_VALUE/gdp, 1)) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  select(CNA_PRODUIT, Cna_produit, date, B2_gdp) %>%
  spread(date, B2_gdp) %>%
  mutate(change = `2022-10-01`-`2006-10-01`) %>%
  arrange(-change) %>%
  print_table_conditional()
CNA_PRODUIT Cna_produit 2006-10-01 2019-10-01 2022-10-01 change
A17-HZ A17-HZ - Transports et entreposage 1.0 1.3 1.8 0.8
A17-AZ A17-AZ - Agriculture, sylviculture et pêche 1.5 1.3 1.9 0.4
A17-C2 A17-C2 - Cokéfaction et raffinage 0.0 0.0 0.3 0.3
A17-GZ A17-GZ - Commerce ; réparation d'automobiles et de motocycles 3.2 3.3 3.5 0.3
A17-C1 A17-C1 - Fabrication de denrées alimentaires, de boissons et de produits à base de tabac 0.9 0.8 0.9 0.0
A17-OQ A17-OQ - Administration publique, enseignement, santé humaine et action sociale 4.3 4.5 4.3 0.0
DSN-CNT Tertiaire principalement non marchand (OQ) 4.3 4.5 4.3 0.0
A17-LZ A17-LZ - Activités immobilières 9.7 9.6 9.6 -0.1
A17-DE A17-DE - Industries extractives, énergie, eau, gestion des déchets et dépollution 1.5 1.4 1.4 -0.1
A17-FZ A17-FZ - Construction 1.8 1.9 1.7 -0.1
A17-C3 A17-C3 - Fabrication d'équipements électriques, électroniques, informatiques ; fabrication de machines 0.6 0.5 0.4 -0.2
A17-C4 A17-C4 - Fabrication de matériels de transport 0.6 0.7 0.4 -0.2
DI-CNT Industrie (DE, C1, C2, C3, C4, C5) 5.6 5.2 5.3 -0.3
A17-C5 A17-C5 - Fabrication d'autres produits industriels 2.1 1.8 1.8 -0.3
DIM-CNT Industrie manufacturière (C1, C2, C3, C4, C5) 4.2 3.7 3.9 -0.3
A17-RU A17-RU - Autres activités de services 0.8 0.7 0.4 -0.4
A17-IZ A17-IZ - Hébergement et restauration 0.9 0.8 0.4 -0.5
A17-JZ A17-JZ - Information et communication 2.2 1.9 1.6 -0.6
A17-KZ A17-KZ - Activités financières et d'assurance 0.9 0.8 0.3 -0.6
A17-MN A17-MN - Activités scientifiques et techniques ; services administratifs et de soutien 4.0 3.7 3.3 -0.7
D-CNT Ensemble des biens et services 35.8 35.1 34.1 -1.7
DS-CNT Ensemble des services 28.7 28.5 27.0 -1.7
DSM-CNT Tertiaire principalement marchand (GZ, HZ, IZ, JZ, KZ, LZ, MN, RU) 22.7 22.1 21.0 -1.7
SMNA-CNT Ensemble principalement marchand non agricole 30.1 29.2 28.0 -2.1

Transports, Energie, Alimentation

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-HZ", "A17-C1", "A17-C2"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2000-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-HZ", "A17-C1", "A17-C2"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2000-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Industrie

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-C1", "A17-C2", "A17-C3", "A17-C4", "A17-C5"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.7),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2000-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-C1", "A17-C2", "A17-C3", "A17-C4", "A17-C5"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2000-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.5),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 0.5),
                labels = percent_format(accuracy = .1)) +
  scale_x_date(breaks = seq(1920, 2100, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Grands ensembles

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("DI-CNT", "DIM-CNT", "DS-CNT", "DSM-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2000-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("DI-CNT", "DIM-CNT", "DS-CNT", "DSM-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2000-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.5),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Excédent Brut / VA par branche

All

Code
`CNT-2014-CB` %>%
  filter(TIME_PERIOD %in% c("2023-Q1", "2022-Q1")) %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, TIME_PERIOD, CNA_PRODUIT, OBS_VALUE) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(B2_B1 = round(100*B2/B1, 1)) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  select(Cna_produit, TIME_PERIOD, B2_B1) %>%
  spread(TIME_PERIOD, B2_B1) %>%
  mutate(change = `2023-Q1` - `2022-Q1`) %>%
  arrange(change) %>%
  print_table_conditional()
Cna_produit 2022-Q1 2023-Q1 change
A17-IZ - Hébergement et restauration 27.2 15.2 -12.0
A17-KZ - Activités financières et d'assurance 17.3 9.7 -7.6
A17-HZ - Transports et entreposage 43.4 36.6 -6.8
A17-RU - Autres activités de services 23.5 17.1 -6.4
A17-OQ - Administration publique, enseignement, santé humaine et action sociale 23.4 21.2 -2.2
Tertiaire principalement non marchand (OQ) 23.4 21.2 -2.2
A17-JZ - Information et communication 34.1 32.5 -1.6
Ensemble des services 36.4 35.3 -1.1
Tertiaire principalement marchand (GZ, HZ, IZ, JZ, KZ, LZ, MN, RU) 42.1 41.0 -1.1
A17-AZ - Agriculture, sylviculture et pêche 92.7 92.5 -0.2
A17-MN - Activités scientifiques et techniques ; services administratifs et de soutien 26.2 26.0 -0.2
A17-GZ - Commerce ; réparation d'automobiles et de motocycles 35.5 35.5 0.0
Ensemble des biens et services 38.0 38.3 0.3
Ensemble principalement marchand non agricole 40.9 41.6 0.7
A17-C2 - Cokéfaction et raffinage 88.3 89.2 0.9
A17-C5 - Fabrication d'autres produits industriels 34.1 35.1 1.0
A17-LZ - Activités immobilières 83.0 84.3 1.3
A17-FZ - Construction 31.4 33.9 2.5
Industrie manufacturière (C1, C2, C3, C4, C5) 33.5 39.8 6.3
A17-DE - Industries extractives, énergie, eau, gestion des déchets et dépollution 62.7 69.7 7.0
A17-C3 - Fabrication d'équipements électriques, électroniques, informatiques ; fabrication de machines 30.1 37.2 7.1
Industrie (DE, C1, C2, C3, C4, C5) 40.0 47.2 7.2
A17-C4 - Fabrication de matériels de transport 21.1 33.6 12.5
A17-C1 - Fabrication de denrées alimentaires, de boissons et de produits à base de tabac 29.1 47.9 18.8

Total VS Energie

Tous

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  #filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.4, 0.3),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

1990-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.4, 0.3),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

Total VS Energie VS Total Hors Energie

Tous

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(CNA_PRODUIT, OBS_VALUE) %>%
  mutate(`D-CNT-A17-DE` = `D-CNT` - `A17-DE`) %>%
  select(-`A17-DE`) %>%
  gather(CNA_PRODUIT, OBS_VALUE, -date, -OPERATION) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  mutate(Cna_produit = ifelse(CNA_PRODUIT == "D-CNT-A17-DE", "Ensemble des biens et services, sans le secteur énergétique", Cna_produit)) %>%
  #filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.6, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

1970-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(CNA_PRODUIT, OBS_VALUE) %>%
  mutate(`D-CNT-A17-DE` = `D-CNT` - `A17-DE`) %>%
  select(-`A17-DE`) %>%
  gather(CNA_PRODUIT, OBS_VALUE, -date, -OPERATION) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  mutate(Cna_produit = ifelse(CNA_PRODUIT == "D-CNT-A17-DE", "Ensemble des biens et services, sans le secteur énergétique", Cna_produit)) %>%
  filter(date >= as.Date("1970-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.65, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

1990-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(CNA_PRODUIT, OBS_VALUE) %>%
  mutate(`D-CNT-A17-DE` = `D-CNT` - `A17-DE`) %>%
  select(-`A17-DE`) %>%
  gather(CNA_PRODUIT, OBS_VALUE, -date, -OPERATION) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  mutate(Cna_produit = ifelse(CNA_PRODUIT == "D-CNT-A17-DE", "Ensemble des biens et services, sans le secteur énergétique", Cna_produit)) %>%
  filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.3, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

2010-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(CNA_PRODUIT, OBS_VALUE) %>%
  mutate(`D-CNT-A17-DE` = `D-CNT` - `A17-DE`) %>%
  select(-`A17-DE`) %>%
  gather(CNA_PRODUIT, OBS_VALUE, -date, -OPERATION) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  mutate(Cna_produit = ifelse(CNA_PRODUIT == "D-CNT-A17-DE", "Ensemble des biens et services, sans le secteur énergétique", Cna_produit)) %>%
  filter(date >= as.Date("2010-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

Total VS Energie VS Agro-Alimentaire

Tous

% de la branche

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1),
                limits = c(0, 0.85)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

% de la VA

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B1", "B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'Exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 0.5),
                labels = percent_format(accuracy = .1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

% de la VA

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B1", "B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'Exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 0.5),
                labels = percent_format(accuracy = .1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2010-

% of B1 de la branche

avec 0
Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1),
                limits = c(0, 0.75)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

sans 0
Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  arrange(desc(date)) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels") +
  geom_text(data = . %>%
              filter(date == as.Date("2023-10-01")), aes(x = date, y = B2/B1, label = percent(B2/B1)))

% de la production (définition finance entreprise)

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "P1E"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/P1E) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  arrange(desc(date)) %>%
  ggplot + geom_line(aes(x = date, y = B2/P1E, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la production)") +
  theme(legend.position = c(0.5, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Production)",
       caption = "Source: INSEE, Comptes Trimestriels") +
  geom_text(data = . %>%
              filter(date == as.Date("2023-10-01")), aes(x = date, y = B2/P1E, label = percent(B2/P1E)))

sans 0
Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2017-01-01")) %>%
  arrange(desc(date)) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.45, 0.85),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels") +
  geom_text(data = . %>%
              filter(date == as.Date("2023-10-01")), aes(x = date, y = B2/B1, label = percent(B2/B1)))

% of B1 de la branche

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c( "D-CNT", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels") +
  geom_text(data = . %>%
              filter(date == as.Date("2023-10-01")), aes(x = date, y = B2/B1, label = percent(B2/B1), color = Cna_produit))

Avec les biens et services

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c( "D-CNT", "A17-C1", "A17-GZ"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit, linetype = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 2),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels du 1er trimestre 2023")

% de la VA

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B1", "B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2010-01-01")) %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  scale_color_manual(values = c("forestgreen", "brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  labs(title = "Taux de marge (en % de la Valeur Ajoutée)",
       caption = "Source: INSEE, Comptes Trimestriels")

Total VS Raffinerie

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-C2", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.4, 0.3),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1),
                limits = c(0, 0.75)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Total VS Services de Transport

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-HZ", "D-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("1990-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  scale_color_manual(values = c("brown", "black")) +
  theme_minimal() +
  xlab("") + ylab("Taux de marge (% de la VA)") +
  theme(legend.position = c(0.4, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1),
                limits = c(0, 0.75)) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Transports, Energie, Alimentation

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B1", "B2"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-HZ", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  left_join(gdp_quarterly, by = "date") %>%
  ggplot + geom_line(aes(x = date, y = B2/gdp, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("Excédent brut d'exploitation (% du PIB)") +
  theme(legend.position = c(0.5, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

Services: IZ, KZ, HZ, RU, JZ

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-IZ", "A17-KZ", "A17-HZ", "A17-RU", "A17-JZ"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.5, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 10),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2010-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-IZ", "A17-KZ", "A17-HZ", "A17-RU", "A17-JZ"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2010-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 10),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

DE, AZ, C1

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-DE", "A17-AZ", "A17-C1"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 10),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

C2, C3, C5

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-C5", "A17-C3", "A17-C4"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 10),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2010-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("A17-C5", "A17-C3", "A17-C4"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2010-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 10),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

DI-CNT, DIM-CNT, DS-CNT

All

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("DI-CNT", "DIM-CNT", "DS-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.6, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 5),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

2010-

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B2", "B1"),
         #INDICATEUR == "CNT-COMPTE_EXPLOITATION_BRANCHES",
         CNA_PRODUIT %in% c("DI-CNT", "DIM-CNT", "DS-CNT"),
         VALORISATION %in% c("V", "SO")) %>%
  select(OPERATION, CNA_PRODUIT, TIME_PERIOD, OBS_VALUE) %>%
  quarter_to_date %>%
  filter(date >= as.Date("2010-01-01")) %>%
  spread(OPERATION, OBS_VALUE) %>%
  mutate(profit_share = B2/B1) %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  ggplot + geom_line(aes(x = date, y = B2/B1, color = Cna_produit)) +
  theme_minimal() +
  xlab("") + ylab("") +
  theme(legend.position = c(0.6, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-100, 500, 1),
                labels = percent_format(accuracy = 1)) +
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y"))

C1, C2, C3, C4, C5

2017T2-

Code
`CNT-2014-CB` %>%
  filter(CNA_PRODUIT %in% c("A17-C1", "A17-C2", "A17-C3", "A17-C4", "A17-C5"),
         OPERATION == "B1",
         VALORISATION == "L") %>%
  select_if(~ n_distinct(.) > 1) %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2017-04-01")) %>%
  group_by(CNA_PRODUIT) %>%
  mutate(OBS_VALUE = 100*OBS_VALUE / OBS_VALUE[date == as.Date("2017-04-01")]) %>%
  ggplot + geom_line(aes(x = date, y = OBS_VALUE, color = Cna_produit)) +
  xlab("") + ylab("") +  theme_minimal() +
  scale_x_date(breaks = seq.Date(from = as.Date("2017-04-01"), to = as.Date("2023-10-01"), by = "6 months"),
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0, 400, 20)) +
  theme(legend.position = c(0.5, 0.8),
        legend.title = element_blank())

2019T4-

Code
`CNT-2014-CB` %>%
  filter(CNA_PRODUIT %in% c("A17-C1", "A17-C2", "A17-C3", "A17-C4", "A17-C5"),
         OPERATION == "B1",
         VALORISATION == "L") %>%
  select_if(~ n_distinct(.) > 1) %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2019-10-01")) %>%
  group_by(CNA_PRODUIT) %>%
  mutate(OBS_VALUE = 100*OBS_VALUE / OBS_VALUE[date == as.Date("2019-10-01")]) %>%
  ggplot + geom_line(aes(x = date, y = OBS_VALUE, color = Cna_produit)) +
  xlab("") + ylab("") +  theme_minimal() +
  scale_x_date(breaks = seq.Date(from = as.Date("2019-10-01"), to = as.Date("2023-10-01"), by = "quarter"),
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0, 400, 20)) +
  theme(legend.position = c(0.5, 0.8),
        legend.title = element_blank())

Volume des Branches: Services Non Marchands, Marchands, Industrie

2011T1-

Code
`CNT-2014-CB` %>%
  filter(CNA_PRODUIT %in% c("DSN-CNT", "DSM-CNT", "DIM-CNT", "A17-FZ"),
         OPERATION == "B1",
         VALORISATION == "L") %>%
  select_if(~ n_distinct(.) > 1) %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2011-01-01")) %>%
  group_by(CNA_PRODUIT) %>%
  mutate(OBS_VALUE = 100*OBS_VALUE / OBS_VALUE[date == as.Date("2017-04-01")]) %>%
  ggplot + geom_line(aes(x = date, y = OBS_VALUE, color = Cna_produit)) +
  xlab("") + ylab("Emploi Trimestriel (100 = 2017T2)") +  theme_minimal() +
  scale_x_date(breaks = seq(1960, 2023, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 120, 2)) +
  theme(legend.position = c(0.7, 0.2),
        legend.title = element_blank())

2017T2-

Code
`CNT-2014-CB` %>%
  filter(CNA_PRODUIT %in% c("DSN-CNT", "DSM-CNT", "DIM-CNT", "A17-FZ"),
         OPERATION == "B1",
         VALORISATION == "L") %>%
  select_if(~ n_distinct(.) > 1) %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2017-04-01")) %>%
  group_by(CNA_PRODUIT) %>%
  mutate(OBS_VALUE = 100*OBS_VALUE / OBS_VALUE[date == as.Date("2017-04-01")]) %>%
  ggplot + geom_line(aes(x = date, y = OBS_VALUE, color = Cna_produit)) +
  xlab("") + ylab("Emploi Trimestriel (100 = 2017T2)") +  theme_minimal() +
  scale_x_date(breaks = seq(1960, 2023, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 120, 2)) +
  theme(legend.position = c(0.32, 0.2),
        legend.title = element_blank())

2019T4-

Code
`CNT-2014-CB` %>%
  filter(CNA_PRODUIT %in% c("DSN-CNT", "DSM-CNT", "DIM-CNT", "A17-FZ"),
         OPERATION == "B1",
         VALORISATION == "L") %>%
  select_if(~ n_distinct(.) > 1) %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  filter(date >= as.Date("2019-10-01")) %>%
  arrange(date) %>%
  group_by(CNA_PRODUIT) %>%
  mutate(OBS_VALUE = 100*OBS_VALUE/OBS_VALUE[date == as.Date("2019-10-01")]) %>%
  ggplot + geom_line(aes(x = date, y = OBS_VALUE, color = Cna_produit)) +
  xlab("") + ylab("") +  theme_minimal() +
  scale_x_date(breaks = seq.Date(from = as.Date("2019-10-01"), to = as.Date("2023-10-01"), by = "quarter"),
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0, 120, 5)) +
  theme(legend.position = c(0.7, 0.2),
        legend.title = element_blank())

Valeur VS Volume

C1 - Fabrication de denrées alimentaires, de boissons et de produits à base de tabac

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-C1",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

C2 - Cokéfaction et raffinage

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-C2",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.01, 0.02, 0.05, 0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.01, prefix = "", suffix = "M"))

C3 - Fabrication d’équipements électriques, électroniques, informatiques ; fabrication de machines

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-C3",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

C4 - Fabrication de matériels de transport

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-C4",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

C5 - Fabrication d’autres produits industriels

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-C5",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

DIM-CNT - C1+C2+C3+C4+C5 - Industrie manuf.

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "DIM-CNT",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

DI-CNT

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "DI-CNT",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

DS-CNT

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "DS-CNT",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50, 100, 200, 500),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

GZ

Code
`CNT-2014-CB` %>%
  filter(INDICATEUR == "CNT-COMPTE_PRODUCTION_BRANCHES",
         CNA_PRODUIT == "A17-GZ",
         OPERATION == "B1") %>%
  select(VALORISATION, OBS_VALUE, TIME_PERIOD) %>%
  quarter_to_date %>%
  left_join(VALORISATION, by = "VALORISATION") %>%
  ggplot() + theme_minimal() + ylab("") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Valorisation, linetype = Valorisation)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_x_date(breaks = seq(1920, 2100, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.3, 0.5, 0.8, 1, 2, 3, 5, 10, 20, 50),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

Emploi Total 1995-

Industrie, Construction

Code
`CNT-2014-CB` %>%
  filter(OPERATION == "EMPS",
         CNA_PRODUIT %in% c("A17-FZ", "DIM-CNT", ""),
         UNIT_MEASURE == "INDIVIDUS") %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  arrange(CNA_PRODUIT, date) %>%
  filter(date >= as.Date("2011-01-01")) %>%
  ggplot() + theme_minimal() + ylab("Nombre d'actifs occupés") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Cna_produit, linetype = Cna_produit)) +
  
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = c(seq(0, 40, 0.1), seq(0, 1, 0.1), seq(0, 0.1, 0.01)),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

Services

Code
`CNT-2014-CB` %>%
  filter(OPERATION == "EMPS",
         CNA_PRODUIT %in% c("DSM-CNT", "DSN-CNT ", ""),
         UNIT_MEASURE == "INDIVIDUS") %>%
  quarter_to_date %>%
  left_join(CNA_PRODUIT, by = "CNA_PRODUIT") %>%
  arrange(CNA_PRODUIT, date) %>%
  filter(date >= as.Date("2011-01-01")) %>%
  ggplot() + theme_minimal() + ylab("Nombre d'actifs occupés") + xlab("") +
  geom_line(aes(x = date, y = OBS_VALUE/10^3, color = Cna_produit, linetype = Cna_produit)) +
  
  scale_x_date(breaks = seq(1920, 2100, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.5, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = c(seq(0, 40, 0.1), seq(0, 1, 0.1), seq(0, 0.1, 0.01)),
                labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "M"))

Taux de marge par branches

Code
`CNT-2014-CB` %>%
  filter(OPERATION %in% c("B1", "B2"),
         grepl("A17", CNA_PRODUIT)) %>%
  mutate(variable = paste0(OPERATION, "_", VALORISATION)) %>%
  quarterend_to_date() %>%
  arrange(CNA_PRODUIT, date, variable) %>%
  select(CNA_PRODUIT, date, variable, OBS_VALUE) %>%
  spread(variable, OBS_VALUE) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}