9 International Trade of EU

Libraries we will need:

As usual, we will modify the EU countries tables:

And we will get the shapefiles of EU countries to be used in maos and choropleths:

9.1 Exports of EU countries inside and outside EU

Table ext_tec03 contains annual data about international trade of EU countries, trade by partner country and NACE Rev. 2 activity. Let’s download:

Let us examine a little bit the data. We choose Germany for the year 2016 as example:

## # A tibble: 1,560 × 7
##    unit   stk_flow nace_r2 partner   geo    time values
##    <chr>  <chr>    <chr>   <chr>     <chr> <dbl>  <dbl>
##  1 NR_ENT EXP      A_F_H-U AE        DE     2016   1173
##  2 NR_ENT EXP      A_F_H-U AFR_N     DE     2016   1115
##  3 NR_ENT EXP      A_F_H-U AFR_OTH   DE     2016   1545
##  4 NR_ENT EXP      A_F_H-U AME_C_CRB DE     2016   1049
##  5 NR_ENT EXP      A_F_H-U AME_N     DE     2016   4458
##  6 NR_ENT EXP      A_F_H-U AME_S     DE     2016   1247
##  7 NR_ENT EXP      A_F_H-U AR        DE     2016    269
##  8 NR_ENT EXP      A_F_H-U ASI_NME   DE     2016   3084
##  9 NR_ENT EXP      A_F_H-U ASI_OTH   DE     2016   5361
## 10 NR_ENT EXP      A_F_H-U AT        DE     2016   1778
## # … with 1,550 more rows

We get a lot of data because we the dataset provides multiple entries for : - unit - flow - nace_r2 - partner

## # A tibble: 780 × 7
##    unit    stk_flow nace_r2 partner   geo    time   values
##    <chr>   <chr>    <chr>   <chr>     <chr> <dbl>    <dbl>
##  1 THS_EUR EXP      A_F_H-U AE        DE     2016  307960.
##  2 THS_EUR EXP      A_F_H-U AFR_N     DE     2016  345850.
##  3 THS_EUR EXP      A_F_H-U AFR_OTH   DE     2016  583489.
##  4 THS_EUR EXP      A_F_H-U AME_C_CRB DE     2016  531009.
##  5 THS_EUR EXP      A_F_H-U AME_N     DE     2016 3561899.
##  6 THS_EUR EXP      A_F_H-U AME_S     DE     2016  676355.
##  7 THS_EUR EXP      A_F_H-U AR        DE     2016   73745.
##  8 THS_EUR EXP      A_F_H-U ASI_NME   DE     2016 1123428.
##  9 THS_EUR EXP      A_F_H-U ASI_OTH   DE     2016 5338715.
## 10 THS_EUR EXP      A_F_H-U AT        DE     2016 2723769.
## # … with 770 more rows

9.2 Intra EU trade

Get the data

Filter:

## # A tibble: 70 × 7
##    unit    stk_flow nace_r2 partner geo    time     values
##    <chr>   <chr>    <chr>   <chr>   <chr> <dbl>      <dbl>
##  1 THS_EUR EXP      TOTAL   INT_EU  AT     2017 104803571.
##  2 THS_EUR EXP      TOTAL   INT_EU  BA     2017   4021610.
##  3 THS_EUR EXP      TOTAL   INT_EU  BE     2017 273351525.
##  4 THS_EUR EXP      TOTAL   INT_EU  BG     2017  16985170.
##  5 THS_EUR EXP      TOTAL   INT_EU  CH     2017 120059878.
##  6 THS_EUR EXP      TOTAL   INT_EU  CY     2017   1111658.
##  7 THS_EUR EXP      TOTAL   INT_EU  CZ     2017  91528346.
##  8 THS_EUR EXP      TOTAL   INT_EU  DE     2017 634176947.
##  9 THS_EUR EXP      TOTAL   INT_EU  DK     2017  54134399.
## 10 THS_EUR EXP      TOTAL   INT_EU  EE     2017   9242929.
## # … with 60 more rows

Join with eu_countries:

## # A tibble: 56 × 8
##    unit    stk_flow nace_r2 partner geo    time     values country 
##    <chr>   <chr>    <chr>   <chr>   <chr> <dbl>      <dbl> <chr>   
##  1 THS_EUR EXP      TOTAL   INT_EU  AT     2017 104803571. Austria 
##  2 THS_EUR EXP      TOTAL   INT_EU  BE     2017 273351525. Belgium 
##  3 THS_EUR EXP      TOTAL   INT_EU  BG     2017  16985170. Bulgaria
##  4 THS_EUR EXP      TOTAL   INT_EU  CY     2017   1111658. Cyprus  
##  5 THS_EUR EXP      TOTAL   INT_EU  CZ     2017  91528346. Czechia 
##  6 THS_EUR EXP      TOTAL   INT_EU  DE     2017 634176947. Germany 
##  7 THS_EUR EXP      TOTAL   INT_EU  DK     2017  54134399. Denmark 
##  8 THS_EUR EXP      TOTAL   INT_EU  EE     2017   9242929. Estonia 
##  9 THS_EUR EXP      TOTAL   INT_EU  EL     2017  15134594. Greece  
## 10 THS_EUR EXP      TOTAL   INT_EU  ES     2017 172651570. Spain   
## # … with 46 more rows

Pivot the the table to add more columns:

Mutate and store the data:

Plot the data as points:

Or plot the data as chorepleth map: