Code
tibble(DOWNLOAD_TIME = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/gov_10q_ggnfa.RData")$mtime)) %>%
print_table_conditional()
DOWNLOAD_TIME |
---|
2024-10-09 |
Data - Eurostat
tibble(DOWNLOAD_TIME = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/gov_10q_ggnfa.RData")$mtime)) %>%
print_table_conditional()
DOWNLOAD_TIME |
---|
2024-10-09 |
LAST_COMPILE |
---|
2024-11-22 |
%>%
gov_10q_ggnfa group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
head(1) %>%
print_table_conditional()
time | Nobs |
---|---|
2024Q1 | 14757 |
%>%
gov_10q_ggnfa 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 | 471168 |
MIO_EUR | Million euro | 471073 |
PC_GDP | Percentage of gross domestic product (GDP) | 467193 |
%>%
gov_10q_ggnfa left_join(sector, by = "sector") %>%
group_by(sector, Sector) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
if (is_html_output()) print_table(.) else .} {
sector | Sector | Nobs |
---|---|---|
S13 | General government | 616911 |
S1312 | State government | 216129 |
S1314 | Social security funds | 191863 |
S1313 | Local government | 189612 |
S1311 | Central government | 189600 |
S212 | Institutions of the EU | 5319 |
%>%
gov_10q_ggnfa left_join(s_adj, by = "s_adj") %>%
group_by(s_adj, S_adj) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
if (is_html_output()) print_table(.) else .} {
s_adj | S_adj | Nobs |
---|---|---|
NSA | Unadjusted data (i.e. neither seasonally adjusted nor calendar adjusted data) | 1219210 |
SCA | Seasonally and calendar adjusted data | 163339 |
SA | Seasonally adjusted data, not calendar adjusted data | 22257 |
TC | Trend cycle data | 4628 |
%>%
gov_10q_ggnfa 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_10q_ggnfa 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_10q_ggnfa group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
print_table_conditional()
%>%
gov_10q_ggnfa filter(time %in% c("2022Q2", "2022Q1"),
== "S13",
sector == "PC_GDP",
unit == "B9",
na_item == "NSA") %>%
s_adj left_join(geo, by = "geo") %>%
select_if(~ n_distinct(.) > 1) %>%
spread(time, values) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
select(Flag, Geo, geo, everything()) %>%
arrange(`2022Q2`) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .} {
%>%
gov_10q_ggnfa filter(sector == "S13",
== "PC_GDP",
unit == "B9",
na_item %in% c("FR", "DE", "IT", "ES", "NL"),
geo == "NSA") %>%
s_adj left_join(geo, by = "geo") %>%
quarter_to_date() %>%
left_join(colors, by = c("Geo" = "country")) %>%
mutate(values = values / 100) %>%
ggplot(.) + theme_minimal() + xlab("") + ylab("Deficit") +
geom_line(aes(x = date, y = values, color = color)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-10, 260, 1),
labels = scales::percent_format(acc = 1)) +
scale_x_date(breaks = as.Date(paste0(seq(1700, 2100, 2), "-01-01")),
labels = date_format("%Y"))
%>%
gov_10q_ggnfa filter(sector == "S13",
== "PC_GDP",
unit == "B9",
na_item %in% c("FR", "DE", "IT", "ES", "NL"),
geo == "NSA") %>%
s_adj left_join(geo, by = "geo") %>%
quarter_to_date() %>%
left_join(colors, by = c("Geo" = "country")) %>%
mutate(values = values / 100) %>%
filter(date >= as.Date("2000-01-01")) %>%
ggplot(.) + theme_minimal() + xlab("") + ylab("Deficit") +
geom_line(aes(x = date, y = values, color = color)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-100, 260, 1),
labels = scales::percent_format(acc = 1)) +
scale_x_date(breaks = as.Date(paste0(seq(1700, 2100, 2), "-01-01")),
labels = date_format("%Y"))