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 |
Data - Eurostat
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 |
---|
2024-11-22 |
%>%
gov_10a_main group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
head(1) %>%
print_table_conditional()
time | Nobs |
---|---|
2023 | 46175 |
%>%
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 |
%>%
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 |
%>%
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 .} {
%>%
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 .} {
%>%
gov_10a_main group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
print_table_conditional()
%>%
gov_10a_main filter(sector == "S13",
== "2019",
time == "PC_GDP",
unit %in% c("D39PAY", "D29PAY", "D29REC", "D39REC")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2020",
time == "PC_GDP",
unit %in% c("D39PAY", "D29PAY", "D29REC", "D39REC")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2020",
time == "PC_GDP",
unit %in% c("D39PAY")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2019",
time == "PC_GDP",
unit %in% c("D39PAY"),
na_item %in% c("FR", "DE", "IT", "ES", "BE", "NL", "EA19", "EU27_2020", "SE")) %>%
geo 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2020",
time == "PC_GDP",
unit %in% c("FR", "DE", "IT")) %>%
geo 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()
%>%
gov_10a_main filter(sector == "S13",
== "2022",
time == "PC_GDP",
unit %in% c("TE")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2021",
time == "PC_GDP",
unit %in% c("TE")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "2020",
time == "PC_GDP",
unit %in% c("TE")) %>%
na_item 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 .} {
%>%
gov_10a_main filter(sector == "S13",
== "PC_GDP",
unit %in% c("TE"),
na_item %in% c("FR", "IT", "BE", "EL")) %>%
geo %>%
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) %>%
+ theme_minimal() + xlab("") + ylab("Dépenses publiques (Points de PIB)") +
ggplot 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))
%>%
gov_10a_main filter(sector == "S13",
== "PC_GDP",
unit %in% c("TE"),
na_item %in% c("FR", "IT", "BE", "EL")) %>%
geo %>%
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) %>%
+ theme_minimal() + xlab("") + ylab("Dépenses publiques (Points de PIB)") +
ggplot 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))
load_data("eurostat/nama_10_gdp.RData")
<- nama_10_gdp %>%
gdp filter(na_item == "B1GQ",
# CLV10_MEUR: Chain linked volumes (2010), million euro
== "CP_MNAC") %>%
unit select(geo, time, gdp = values)
load_data("eurostat/nasa_10_nf_tr.RData")
<- nasa_10_nf_tr %>%
data filter(geo %in% c("FR", "IT", "BE", "EL"),
== "D612",
na_item == "RECV",
direct == "CP_MNAC",
unit == "S13") %>%
sector 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 + theme_minimal() + xlab("") + ylab("") +
ggplot 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))