Produit Intérieur Brut - CHELEM_2018_PIB_VA_BvD_20180702

Data - CEPII

Nobs - Javascript

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  left_join(iso3c, by = "iso3c") %>%
  group_by(iso3c, Iso3c) %>%
  summarise(Nobs = n(),
            date1 = first(date),
            date2 = last(date)) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Produit Intérieur Brut

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(date %in% (c(1960, 1980, 2000, 2020) %>% paste0("-01-01") %>% as.Date)) %>%
  mutate(year = year(date)) %>%
  select(-date) %>%
  spread(year, value) %>%
  arrange(-`2020`) %>%
  mutate_at(vars(-iso3c), funs(paste0("$ ", round(./1000), " Bn"))) %>%
  left_join(iso3c, by = "iso3c") %>%
  group_by(iso3c, Iso3c) %>%
  select(iso3c, Iso3c, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Produit Intérieur Brut (%)

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(date %in% (c(1960, 1980, 2000, 2020) %>% paste0("-01-01") %>% as.Date)) %>%
  mutate(year = year(date)) %>%
  select(-date) %>%
  spread(year, value) %>%
  arrange(-`2020`) %>%
  mutate_at(vars(-iso3c), funs(paste0(round(100*./.[1], 1), " %"))) %>%
  left_join(iso3c, by = "iso3c") %>%
  group_by(iso3c, Iso3c) %>%
  select(iso3c, Iso3c, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

GDP in France, Italy, Germany

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(iso3c %in% c("FRA", "DEU", "ITA")) %>%
  left_join(iso3c, by = "iso3c") %>%
  ggplot() + theme_minimal() + scale_color_manual(values = viridis(4)[1:3]) +
  geom_line(aes(x = date, y = value/1000, color = Iso3c, linetype = Iso3c)) +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 5), "-01-01")),
               labels = date_format("%y")) +
  theme(legend.position = c(0.2, 0.85),
        legend.title = element_blank()) +
  xlab("") + ylab("") +
  scale_y_log10(breaks = c(seq(0, 50, 10), seq(0, 500, 100), seq(0, 7000, 500)),
                labels = dollar_format(suffix = " Bn", accuracy = 1))

GDP in USA, EU, China

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(iso3c %in% c("USA", "UE", "CHN")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = value/1000, color = iso3c, linetype = iso3c)) + 
  scale_color_manual(values = viridis(4)[1:3]) +
  theme_minimal()  +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 5), "-01-01")),
               labels = date_format("%y")) +
  theme(legend.position = c(0.2, 0.85),
        legend.title = element_blank()) +
  xlab("") + ylab("") +
  scale_y_log10(breaks = c(seq(0, 500, 100), seq(0, 5000, 1000), seq(0, 30000, 10000)),
                labels = dollar_format(suffix = " Bn", accuracy = 1))

GDP

France

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(iso3c %in% c("FRA")) %>%
  select(date, GDP = value) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Germany

Code
CHELEM_2018_PIB_VA_BvD_20180702 %>%
  filter(iso3c %in% c("DEU")) %>%
  select(date, GDP = value) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}