Government revenue, expenditure and main aggregates

Data - Eurostat

Info

LAST_DOWNLOAD

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

LAST_COMPILE

LAST_COMPILE
2024-11-05

Last

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

unit

Code
gov_10a_main %>%
  left_join(unit, by = "unit") %>%
  group_by(unit, Unit) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
unit Unit Nobs
MIO_NAC Million units of national currency 462218
MIO_EUR Million euro 459418
PC_GDP Percentage of gross domestic product (GDP) 457334

sector

Code
gov_10a_main %>%
  left_join(sector, by = "sector") %>%
  group_by(sector, Sector) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
sector Sector Nobs
S1312 State government 289822
S13 General government 272882
S1314 Social security funds 270665
S1313 Local government 269852
S1311 Central government 269810
S1 Total economy 4380
S212 Institutions of the EU 1559

na_item

All

Code
gov_10a_main %>%
  left_join(na_item, by = "na_item") %>%
  group_by(na_item, Na_item) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

geo

Code
gov_10a_main %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  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
gov_10a_main %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  print_table_conditional()

Subsidies, Other taxes on production

2019

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2019",
         unit == "PC_GDP",
         na_item %in% c("D39PAY", "D29PAY", "D29REC", "D39REC")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  left_join(na_item, by = "na_item") %>%
  left_join(geo, by = "geo") %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
         Flag = ifelse(geo %in% c("EU27_2020", "EA19"), "europe", Flag)) %>%
  select(-na_item) %>%
  spread(Na_item, values) %>%
  mutate(Net = `Other taxes on production, receivable` + `Other subsidies on production, receivable` - 
           `Other taxes on production, payable` - `Other subsidies on production, payable`) %>%
  arrange(-`Net`) %>%
  mutate(Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

2020

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2020",
         unit == "PC_GDP",
         na_item %in% c("D39PAY", "D29PAY", "D29REC", "D39REC")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  left_join(na_item, by = "na_item") %>%
  left_join(geo, by = "geo") %>%
  select(-na_item) %>%
  spread(Na_item, values) %>%
  mutate(Net = `Other taxes on production, receivable` + `Other subsidies on production, receivable` - 
           `Other taxes on production, payable` - `Other subsidies on production, payable`) %>%
  arrange(-`Net`) %>%
  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 .}

Subsidies

All

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2020",
         unit == "PC_GDP",
         na_item %in% c("D39PAY")) %>%
  select(-unit, -time, -sector) %>%
  left_join(na_item, by = "na_item") %>%
  left_join(geo, by = "geo") %>%
  select(-na_item) %>%
  spread(Na_item, values) %>%
  arrange(-`Other subsidies on production, payable`) %>%
  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 .}

All

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2019",
         unit == "PC_GDP",
         na_item %in% c("D39PAY"),
         geo %in% c("FR", "DE", "IT", "ES", "BE", "NL", "EA19", "EU27_2020", "SE")) %>%
  select(-unit, -time, -sector) %>%
  left_join(na_item, by = "na_item") %>%
  left_join(geo, by = "geo") %>%
  select(-na_item) %>%
  spread(Na_item, values) %>%
  arrange(-`Other subsidies on production, payable`) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
         Flag = ifelse(geo %in% c("EA19", "EU27_2020"), "europe", Flag),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

France, Germany, Italy

Table, 2020

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2020",
         unit == "PC_GDP",
         geo %in% c("FR", "DE", "IT")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  left_join(na_item, by = "na_item") %>%
  left_join(geo, by = "geo") %>%
  select(-geo) %>%
  spread(Geo, values) %>%
  print_table_conditional()

Total Government Expenditure

Table, 2022

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2022",
         unit == "PC_GDP",
         na_item %in% c("TE")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  arrange(-values) %>%
  left_join(geo, by = "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 .}

Table, 2021

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2021",
         unit == "PC_GDP",
         na_item %in% c("TE")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  arrange(-values) %>%
  left_join(geo, by = "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 .}

Table, 2020

Code
gov_10a_main %>%
  filter(sector == "S13",
         time == "2020",
         unit == "PC_GDP",
         na_item %in% c("TE")) %>%
  select_if(~ n_distinct(.) > 1) %>%
  arrange(-values) %>%
  left_join(geo, by = "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 .}

1995-

Code
gov_10a_main %>%
  filter(sector == "S13",
         unit == "PC_GDP",
         na_item %in% c("TE"),
         geo %in% c("FR", "IT", "BE", "EL")) %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "EA20", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  filter(date >= as.Date("1995-01-01")) %>%
  mutate(values= values / 100) %>%
  ggplot + theme_minimal() + xlab("") + ylab("Dépenses publiques (Points de PIB)") +
  geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + add_4flags +
  scale_x_date(breaks = as.Date(paste0(seq(1940, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 2),
                labels = percent_format(a = 1))

2000-

Code
gov_10a_main %>%
  filter(sector == "S13",
         unit == "PC_GDP",
         na_item %in% c("TE"),
         geo %in% c("FR", "IT", "BE", "EL")) %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "EA20", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  filter(date >= as.Date("2000-01-01")) %>%
  mutate(values= values / 100) %>%
  ggplot + theme_minimal() + xlab("") + ylab("Dépenses publiques (Points de PIB)") +
  geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + add_4flags +
  scale_x_date(breaks = as.Date(paste0(seq(1940, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, 2),
                labels = percent_format(a = 1))

Code
load_data("eurostat/nama_10_gdp.RData")
gdp <- nama_10_gdp %>%
  filter(na_item == "B1GQ",
         # CLV10_MEUR: Chain linked volumes (2010), million euro
         unit == "CP_MNAC") %>%
  select(geo, time, gdp = values)
load_data("eurostat/nasa_10_nf_tr.RData")

data <- nasa_10_nf_tr %>%
  filter(geo %in% c("FR", "IT", "BE", "EL"),
         na_item == "D612",
         direct == "RECV",
         unit == "CP_MNAC",
         sector == "S13") %>%
  select(geo, time, values, sector) %>%
  left_join(gdp, by = c("geo", "time")) %>%
  mutate(values = values/gdp) %>%
  year_to_date %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "EA20", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  filter(date >= as.Date("1995-01-01"))
data %>%
  ggplot + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = values, color = color)) +
  scale_color_identity() + add_3flags +
  scale_x_date(breaks = as.Date(paste0(seq(1940, 2100, 5), "-01-01")),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(0, 100, .2),
                labels = percent_format(a = .1))