Export market shares - 5 years % change - tipsex10

Data - Eurostat

Info

DOWNLOAD_TIME

Code
tibble(DOWNLOAD_TIME = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/tipsex10.RData")$mtime)) %>%
  print_table_conditional()
DOWNLOAD_TIME
2024-11-05

Last

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

geo

Code
tipsex10 %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
  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 .}

bop_item

Code
tipsex10 %>%
  select_if(~n_distinct(.) > 1) %>%
  left_join(bop_item, by = "bop_item") %>%
  group_by(bop_item, Bop_item) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
bop_item Bop_item Nobs
G Goods 642
GS Goods and services 642
S Services 642

France, Germany, Italy, Spain, Netherlands

Goods

Code
tipsex10 %>%
  filter(geo %in% c("FR", "DE", "NL", "ES", "IT"),
         bop_item == "G") %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(values = values/100) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) + theme_minimal() +
  scale_color_identity() + add_5flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2022, 2), "-01-01")),
               labels = date_format("%y")) +
  xlab("") + ylab("Export market shares - 5 years % change - Goods") +
  scale_y_continuous(breaks = 0.01*seq(-300, 200, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  geom_hline(yintercept = -0.06, linetype = "dashed")

Services

Code
tipsex10 %>%
  filter(geo %in% c("FR", "DE", "NL", "ES", "IT"),
         bop_item == "S") %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(values = values/100) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) + theme_minimal() +
  scale_color_identity() + add_5flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2022, 2), "-01-01")),
               labels = date_format("%y")) +
  xlab("") + ylab("Export market shares - 5 years % change - Services") +
  scale_y_continuous(breaks = 0.01*seq(-300, 200, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  geom_hline(yintercept = -0.06, linetype = "dashed")

Goods & Services

Code
tipsex10 %>%
  filter(geo %in% c("FR", "DE", "NL", "ES", "IT"),
         bop_item == "GS") %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  mutate(values = values/100) %>%
  mutate(color = ifelse(geo == "NL", color2, color)) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color)) + theme_minimal() +
  scale_color_identity() + add_5flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2022, 2), "-01-01")),
               labels = date_format("%y")) +
  xlab("") + ylab("Export market shares - 5 years % change - Goods, Services") +
  scale_y_continuous(breaks = 0.01*seq(-300, 200, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  geom_hline(yintercept = -0.06, linetype = "dashed")