Balance of payments by country - annual data (BPM6)

Data - Eurostat

Info

source dataset .html .RData
eurostat bop_c6_a 2024-11-01 2024-10-08

DOWNLOAD_TIME

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

Last

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

bop_item

Code
bop_c6_a %>%
  left_join(bop_item, by = "bop_item") %>%
  group_by(bop_item, Bop_item) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()

sector10

Code
bop_c6_a %>%
  left_join(sector10, by = "sector10") %>%
  group_by(sector10, Sector10) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
sector10 Sector10 Nobs
S1 Total economy 8497149
S13 General Government 1974535
S1P Other sectors than MFIs and general government 1258655
S121 Central Bank 1095382
S123 Money market funds 1094907
S122 Deposit-taking corporations except the central bank 1056440
S12T Monetary Financial Institutions (MFI) other than central bank 1041335
S12M Financial corporations other than MFIs 988702
S1V Non-financial corporations, households and non-profit institutions serving households 986071
S1W Other sectors than General Government 931037
S1Z Sectors other than deposit-taking corporations and general government 20480
S12R Other financial corporations 16638
S1X Monetary authorities 15290

sectpart

Code
bop_c6_a %>%
  left_join(sectpart, by = "sectpart") %>%
  group_by(sectpart, Sectpart) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
sectpart Sectpart Nobs
S1 Total economy 18243382
S12M Financial corporations other than MFIs 100311
S123 Money market funds 98487
S12T Monetary Financial Institutions (MFI) other than central bank 85459
S1P Other sectors than MFIs and general government 84925
S121 Central Bank 82161
S122 Deposit-taking corporations except the central bank 81011
S13 General Government 78422
S1V Non-financial corporations, households and non-profit institutions serving households 76878
S1N Not sectorised 42756
S12K Monetary financial institutions (MFI) 2771
S1Z Sectors other than deposit-taking corporations and general government 58

stk_flow

Code
bop_c6_a %>%
  left_join(stk_flow, by = "stk_flow") %>%
  group_by(stk_flow, Stk_flow) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
stk_flow Stk_flow Nobs
ASS Assets 4139540
CRE Credit 3829355
DEB Debit 2797385
NET Net 2771019
BAL Balance 2754216
LIAB Liabilities 2683090
NI Net FDI inward 506
NO Net FDI outward 506
II Net income on inward FDI 502
IO Net income on outward FDI 502

partner

Code
bop_c6_a %>%
  left_join(partner, by = "partner") %>%
  group_by(partner, Partner) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()

geo

Code
bop_c6_a %>%
  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 .}

time

Code
bop_c6_a %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  print_table_conditional()

Denmark

Goods and Services

Code
bop_c6_a %>%
  filter(geo == "DK",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19", "EXT_EA19", "WRL_REST"),
         bop_item %in% c("GS")) %>%
  left_join(partner, by = "partner") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Partner)) +
 
  theme_minimal()  + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.25, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

Netherlands

Goods and Services

Code
bop_c6_a %>%
  filter(geo == "NL",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19", "EXT_EA19", "WRL_REST"),
         bop_item %in% c("GS")) %>%
  left_join(partner, by = "partner") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Partner)) +
 
  theme_minimal()  + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.25, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

France

Goods and Services

Code
bop_c6_a %>%
  filter(geo == "FR",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19", "EXT_EA19", "WRL_REST"),
         bop_item %in% c("GS")) %>%
  left_join(partner, by = "partner") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Partner)) +
 
  theme_minimal()  + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.25, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

WRL_REST

Code
bop_c6_a %>%
  filter(geo == "FR",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("WRL_REST"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal()  +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("") +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

EA19

Code
bop_c6_a %>%
  filter(geo == "FR",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 0.5),
                labels = percent_format(a = .1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

EXT_EA19

Code
bop_c6_a %>%
  filter(geo == "FR",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EXT_EA19"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, .5),
                labels = percent_format(a = .1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

Germany

Goods and Services

Code
bop_c6_a %>%
  filter(geo == "DE",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19", "EXT_EA19", "WRL_REST"),
         bop_item %in% c("GS")) %>%
  left_join(partner, by = "partner") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Partner)) +
 
  theme_minimal()  + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.25, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

WRL_REST

Code
bop_c6_a %>%
  filter(geo == "DE",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("WRL_REST"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal()  +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("") +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 2),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

EA19

Code
bop_c6_a %>%
  filter(geo == "DE",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EA19"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")

EXT_EA19

Code
bop_c6_a %>%
  filter(geo == "DE",
         stk_flow == "BAL",
         currency == "MIO_EUR",
         partner %in% c("EXT_EA19"),
         bop_item %in% c("CA", "GS", "G")) %>%
  left_join(bop_item, by = "bop_item") %>%
  left_join(B1GQ, by = c("geo", "time")) %>%
  mutate(values = values / B1GQ) %>%
  select(-B1GQ) %>%
  year_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Bop_item)) +
 
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.15, 0.8),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-30, 30, 1),
                labels = percent_format(a = 1)) + 
  geom_hline(yintercept = 0, linetype = "dashed",  color = "black")