Disposable income and net lending - net borrowing - SNA_TABLE2

Data - OECD

Info

Last observation: A: 2023 (N = 15)

First observation: A: 1950 (N = 77)

Last data update: 02 aoû 2026, 09:09. Last compile: 18 aoû 2026, 02:51

Structure

Layout

  • OECD Website. html

B1_GE - Gross domestic product

All Decomposition

Code
SNA_TABLE2 |>
  filter(LOCATION %in% c("FRA", "DEU", "USA", "GBR"),
         obsTime == "2018",
         MEASURE == "C") |>
  select(LOCATION, TRANSACT, obsValue) |>
  left_join(SNA_TABLE2_var$TRANSACT |>
              setNames(c("TRANSACT", "Transact")), by = "TRANSACT") |>
  spread(LOCATION, obsValue) %>%
  mutate_at(vars(-1, -2), funs(ifelse(is.na(.), "", paste0(round(100*./.[TRANSACT == "B1_GE"], 1), " %")))) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

How much data

Code
SNA_TABLE2 |>
  filter(TRANSACT == "B1_GE",
         MEASURE == "C") |>
  left_join(SNA_TABLE2_var$LOCATION |>
              setNames(c("LOCATION", "Location")), 
            by = "LOCATION") |>
  group_by(LOCATION, UNIT, Location) |>
  summarise(year_first = first(obsTime),
            year_last = last(obsTime),
            value_last = last(round(obsValue))) |>
  mutate(Loc = gsub(" ", "-", str_to_lower(Location)),
         Loc = paste0('<img src="../../bib/flags/vsmall/', Loc, '.png" alt="Flag">')) |>
  select(Loc, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

All

US and France

Code
SNA_TABLE2 |>
  filter(obsTime == "2018",
         MEASURE == "C",
         LOCATION %in% c("USA", "FRA")) |>
  select(LOCATION, TRANSACT, obsValue) |>
  left_join(SNA_TABLE2_var$TRANSACT |>
              setNames(c("TRANSACT", "Transact")), by = "TRANSACT") |>
  spread(LOCATION, obsValue) %>%
  mutate_at(vars(-1, -2), funs(ifelse(is.na(.), "", paste0(round(100*./.[TRANSACT == "B1_GE"], 1), " %")))) %>%
  {if (is_html_output()) print_table(.) else .}
TRANSACT Transact FRA USA
B1_GE Gross domestic product (expenditure approach) 100 % 100 %
B1_GS1 Gross domestic product 100 % 100 %
B5_GS1 Gross national income at market prices 102.3 % 101.1 %
B5_NS1 Net national income at market prices 84.1 % 85.1 %
B6GS1 Gross national disposable income 100.3 % 100.4 %
B6NS1 Net national disposable income 82.1 % 84.4 %
B8NS1 Saving, net 5 % 3.1 %
B9S1 Net lending/net borrowing -0.7 % -2.5 %
D1_D4FRS2 Primary incomes receivable from the rest of the world 7.6 % 5.5 %
D1_D4NFRS2 Net primary incomes from the rest of the world 2.3 % 1.4 %
D1_D4TOS2 Primary incomes payable to the rest of the world 5.3 % 4.1 %
D5_D7FRS2 Current transfers receivable from the rest of the world 1.1 % 0.7 %
D5_D7NFRS2 Net current transfers from the rest of the world -2 % -0.7 %
D5_D7TOS2 Current transfers payable to the rest of the world 3.1 % 1.4 %
D8S1 Adjustment for the change in net equity of households in pension funds 0 % 0 %
D9FRS2 Capital transfers receivable from the rest of the world 0.1 % 0 %
D9NFRS2 Net capital transfers from the rest of the world 0 % 0 %
D9TOS2 Capital transfers payable to the rest of the world 0 % 0 %
GDIS1 Gross domestic income 100 % 100.6 %
K1MS1 Consumption of fixed capital 18.2 % 16 %
K1S1 Consumption of fixed capital, capital account 18.2 % 16 %
K2S1 Acquisitions less disposals of non-financial non-produced assets 0 % 0 %
P3S1 Final consumption expenditures 77.2 % 81.3 %
P5S1 Gross capital formation 23.9 % 21.6 %

B6GS1 - Gross National Disposable Income / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "B6GS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6GS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 200, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross National Disposable Income (% of GDP)") + xlab("")

France, Germany, Belgium, Spain, Netherlands, Italy

All

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "BEL", "ESP", "NLD", "ITA"),
         TRANSACT %in% c("B1_GE", "B6GS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6GS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  mutate(color = ifelse(Location == "Netherlands", color2, color)) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross National Disposable Income (% of GDP)") + xlab("")

1995-

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "BEL", "ESP", "NLD", "ITA"),
         TRANSACT %in% c("B1_GE", "B6GS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6GS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  mutate(color = ifelse(Location == "Netherlands", color2, color)) |>
  filter(date >= as.Date("1995-01-01")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 120, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross National Disposable Income (% of GDP)") + xlab("")

B6NS1 - Net national disposable income / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "B6NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net National Disposable Income (% of GDP)") + xlab("")

France, Germany, US, Denmark

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "DNK", "USA"),
         TRANSACT %in% c("B1_GE", "B6NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(LOCATION, Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6NS1 / B1_GE) |>
  select(LOCATION, Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  mutate(color = ifelse(LOCATION == "FRA", color2, color)) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_4flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net National Disposable Income (% of GDP)") + xlab("")

France, Germany, Belgium, Spain, Netherlands, Italy

All

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "BEL", "ESP", "NLD", "ITA"),
         TRANSACT %in% c("B1_GE", "B6NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  mutate(color = ifelse(Location == "Netherlands", color2, color)) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net National Disposable Income (% of GDP)") + xlab("")

1995-

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "BEL", "ESP", "NLD", "ITA"),
         TRANSACT %in% c("B1_GE", "B6NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B6NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  mutate(color = ifelse(Location == "Netherlands", color2, color)) |>
  filter(date >= as.Date("1995-01-01")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_6flags +
  scale_x_date(breaks = seq(1920, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net National Disposable Income (% of GDP)") + xlab("")

B8NS1 - Net Saving / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "B8NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B8NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Saving (% of GDP)") + xlab("")

France, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "ITA"),
         TRANSACT %in% c("B1_GE", "B8NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B8NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_2flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Saving (% of GDP)") + xlab("")

United Kingdom, Japan, United States

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("JPN", "GBR", "USA"),
         TRANSACT %in% c("B1_GE", "B8NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B8NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Saving (% of GDP)") + xlab("")

Switzerland, Germany, Netherlands

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("NLD", "CHE", "DEU"),
         TRANSACT %in% c("B1_GE", "B8NS1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B8NS1 / B1_GE) |>
  select(Location, date, obsValue) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Saving (% of GDP)") + xlab("")

P5S1 - K1S1 - Net capital formation / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "P5S1", "K1S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1 - K1S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net capital formation (% of GDP)") + xlab("")

United Kingdom, Japan, United States

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("GBR", "JPN", "USA"),
         TRANSACT %in% c("B1_GE", "P5S1", "K1S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1 - K1S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net capital formation (% of GDP)") + xlab("")

Switzerland, Germany, Netherlands

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("CHE", "DEU", "NLD"),
         TRANSACT %in% c("B1_GE", "P5S1", "K1S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1 - K1S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net capital formation (% of GDP)") + xlab("")

P5S1 - Gross capital formation / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "P5S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross capital formation (% of GDP)") + xlab("")

United Kingdom, Japan, United States

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("GBR", "JPN", "USA"),
         TRANSACT %in% c("B1_GE", "P5S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross capital formation (% of GDP)") + xlab("")

Switzerland, Germany, Netherlands

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("CHE", "DEU", "NLD"),
         TRANSACT %in% c("B1_GE", "P5S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  spread(TRANSACT, obsValue) |>
  mutate(obsValue = (P5S1) / B1_GE) |>
  filter(!is.na(obsValue)) |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.85, 0.9),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-10, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Gross capital formation (% of GDP)") + xlab("")

B9S1 - Net Lending - Net Borrowing / GDP

France, Germany, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "DEU", "ITA"),
         TRANSACT %in% c("B1_GE", "B9S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B9S1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 100, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Lending - Net Borrowing (% of GDP)") + xlab("")

France, Italy

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("FRA", "ITA"),
         TRANSACT %in% c("B1_GE", "B9S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B9S1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_2flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Lending - Net Borrowing (% of GDP)") + xlab("")

United Kingdom, Japan, United States

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("JPN", "GBR", "USA"),
         TRANSACT %in% c("B1_GE", "B9S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B9S1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Lending - Net Borrowing (% of GDP)") + xlab("")

Switzerland, Germany, Netherlands

Code
SNA_TABLE2 |>
  filter(MEASURE == "C",
         LOCATION %in% c("NLD", "CHE", "DEU"),
         TRANSACT %in% c("B1_GE", "B9S1")) |>
  year_to_date() |>
  left_join(SNA_TABLE2_var$LOCATION, by = "LOCATION") |>
  select(Location, date, TRANSACT, obsValue) |>
  spread(TRANSACT, obsValue) |>
  group_by(Location) |>
  mutate(obsValue = B9S1 / B1_GE) |>
  select(Location, date, obsValue) |>
  na.omit() |>
  left_join(colors, by = c("Location" = "country")) |>
  ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
  scale_color_identity() + theme_minimal() + add_3flags +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-100, 100, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  ylab("Net Lending - Net Borrowing (% of GDP)") + xlab("")