Intra and Extra-EU trade by Member State and by product group - ext_lt_intratrd

Data - Eurostat

Info

LAST_DOWNLOAD

Code
tibble(dataset = c("ext_lt_intratrd", "ext_lt_intratrd", "namq_10_a10")) %>%
  mutate(LAST_DOWNLOAD = as.Date(file.info(paste0("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/", dataset, ".RData"))$mtime)) %>%
  mutate(html = paste0("[html](https://fgeerolf.com/data/eurostat/", dataset, '.html)')) %>%
  print_table_conditional()
dataset LAST_DOWNLOAD html
ext_lt_intratrd 2024-10-08 [html]
ext_lt_intratrd 2024-10-08 [html]
namq_10_a10 2024-11-05 [html]

LAST_COMPILE

LAST_COMPILE
2024-11-05

Last

Code
ext_lt_intratrd %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  head(1) %>%
  print_table_conditional()
time Nobs
2023 5112

indic_et

Code
ext_lt_intratrd %>%
  left_join(indic_et, by = "indic_et") %>%
  group_by(indic_et, Indic_et) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
indic_et Indic_et Nobs
MIO_BAL_VAL Trade balance in million ECU/EURO 14608
MIO_EXP_VAL Exports in million of ECU/EURO 14608
MIO_IMP_VAL Imports in million of ECU/EURO 14608
PC_EXP_PROD Share of exports by product (%) 14608
PC_IMP_PROD Share of imports by product (%) 14608
CONT_EXP_EU Share of exports by Member State (%) 9856
CONT_IMP_EU Share of imports by Member State (%) 9856
PC_TOT_EXP Share of exports by partner in total exports (%) 9856
PC_TOT_IMP Share of imports by partner in total imports (%) 9856

sitc06

Code
ext_lt_intratrd %>%
  left_join(sitc06, by = "sitc06") %>%
  group_by(sitc06, Sitc06) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
sitc06 Sitc06 Nobs
SITC0_1 Food, drinks and tobacco 14058
SITC2_4 Raw materials 14058
SITC3 Mineral fuels, lubricants and related materials 14058
SITC5 Chemicals and related products, n.e.s. 14058
SITC6_8 Other manufactured goods 14058
SITC7 Machinery and transport equipment 14058
SITC9 Commodities and transactions not classified elsewhere in the SITC 14058
TOTAL Total - all products 14058

geo

Code
ext_lt_intratrd %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
         Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

partner

Code
ext_lt_intratrd %>%
  left_join(partner, by = "partner") %>%
  group_by(partner, Partner) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(Partner)),
         Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

time

Code
ext_lt_intratrd %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  print_table_conditional()
time Nobs
2023 5112
2022 5112
2021 5112
2020 5112
2019 5112
2018 5112
2017 5112
2016 5112
2015 5112
2014 5112
2013 5112
2012 5112
2011 5112
2010 5112
2009 5112
2008 5112
2007 5112
2006 5112
2005 5112
2004 5112
2003 5112
2002 5112

Exports

Code
ext_lt_intratrd %>%
  filter(geo %in% c("EU27_2020", "CN_X_HK", "US"),
         # B1GQ: Gross domestic product at market prices
         indic_et == "PC_EXP_PROD",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "CN_X_HK", "China", Geo)) %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(values = values/100) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_3flags + xlab("") + ylab("% of World Exports") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2020, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.85),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 1),
                labels = percent_format(acc = 1))

Share of exports to EU in total exports

EU, Germany, France, Spain, Italy

Code
ext_lt_intratrd %>%
  filter(geo %in% c("DE", "FR", "ES", "IT", "NL"),
         partner == "WORLD",
         # B1GQ: Gross domestic product at market prices
         indic_et == "MIO_EXP_VAL",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  left_join(world_exports, by = "time") %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  mutate(values = values/world_exports) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_5flags + xlab("") +
  ylab("Part des exportations dans les exportations de la Zone € (%)") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 1),
                labels = percent_format(acc = 1))

France, Spain, Italy, Belgium, Netherlands

Code
ext_lt_intratrd %>%
  filter(geo %in% c("FR", "ES", "IT", "NL", "BE"),
         partner == "WORLD",
         # B1GQ: Gross domestic product at market prices
         indic_et == "MIO_EXP_VAL",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  left_join(world_exports, by = "time") %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  mutate(values = values/world_exports) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_5flags + xlab("") +
  ylab("Part des exportations dans les exportations de la Zone € (%)") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 1),
                labels = percent_format(acc = 1))

Finland, Austria, Portugal, Greece, Ireland

Code
ext_lt_intratrd %>%
  filter(geo %in% c("FI", "AT", "PT", "EL", "IE"),
         partner == "WORLD",
         # B1GQ: Gross domestic product at market prices
         indic_et == "MIO_EXP_VAL",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  left_join(world_exports, by = "time") %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  mutate(values = values/world_exports) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_5flags + xlab("") +
  ylab("Part des exportations dans les exportations de la Zone € (%)") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 1),
                labels = percent_format(acc = 1))

Slovakia, Lithuania, Slovenia, Luxembourg

Code
ext_lt_intratrd %>%
  filter(geo %in% c("SK", "LT", "SI", "LU"),
         partner == "WORLD",
         # B1GQ: Gross domestic product at market prices
         indic_et == "MIO_EXP_VAL",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  left_join(world_exports, by = "time") %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  mutate(values = values/world_exports) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_4flags + xlab("") +
  ylab("Part des exportations dans les exportations de la Zone € (%)") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, .2),
                labels = percent_format(acc = .1))

Latvia, Estonia, Cyprus, Malta

Code
ext_lt_intratrd %>%
  filter(geo %in% c("LV", "EE", "CY", "MT"),
         partner == "WORLD",
         # B1GQ: Gross domestic product at market prices
         indic_et == "MIO_EXP_VAL",
         sitc06 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  left_join(world_exports, by = "time") %>%
  mutate(Geo = ifelse(geo == "EU27_2020", "Europe", Geo)) %>%
  year_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  mutate(values = values/world_exports) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + theme_minimal()  + add_4flags + xlab("") +
  ylab("Part des exportations dans les exportations de la Zone € (%)") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, .1),
                labels = percent_format(acc = .1))