indicator: EU direct investment outward stocks detailed by extra EU destination country (tec00055)
postSoviet <- c("AM", "AZ", "BY", "MD", "GE", "KG", "KZ", "RU", "TJ", "TM", "UA", "UZ")
fdi <- get_eurostat("tec00055", time_format = "num")
## Table tec00055 cached at /tmp/RtmpmnDYqb/eurostat/tec00055_num_code_TF.rds
## Keep only post-Soviet countries
fdiPS <- fdi[grepl(paste(postSoviet, collapse = "|"), x = fdi$partner)&nchar(as.character(fdi$partner))==2,]
## Plot the data
fdiPS %>% group_by(partner, time) %>% summarise(values = sum(values, na.rm = TRUE)) %>% ggplot(mapping = aes(x = time, y = values, color = partner)) + geom_line() + scale_x_continuous(breaks=unique(fdiPS$time), name = "") + scale_y_continuous(labels = comma, name = "") + labs(title = "EU direct investment outward stocks by country", subtitle = "Post-Soviet only, excluding Baltic republics", caption = "Eurostat table: tec00055")
fdi <- get_eurostat("tec00050", time_format = "num")
## Table tec00050 cached at /tmp/RtmpmnDYqb/eurostat/tec00050_num_code_TF.rds
## Keep only post-Soviet countries
fdiPS <- fdi[grepl(paste(postSoviet, collapse = "|"), x = fdi$partner)&nchar(as.character(fdi$partner))==2,]
## Plot the data
fdiPS %>% group_by(partner, time) %>% summarise(values = sum(values, na.rm = TRUE)) %>% ggplot(mapping = aes(x = time, y = values, color = partner)) + geom_line() + scale_x_continuous(breaks=unique(fdiPS$time), name = "") + scale_y_continuous(labels = comma, name = "") + labs(title = "EU direct investment outward flows by country of destination", subtitle = "Post-Soviet only, excluding Baltic republics", caption = "Eurostat table: tec00050")