Code
tibble(LAST_DOWNLOAD = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/env_ac_tax.RData")$mtime)) %>%
print_table_conditional()
LAST_DOWNLOAD |
---|
2024-10-09 |
Data - Eurostat
tibble(LAST_DOWNLOAD = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/env_ac_tax.RData")$mtime)) %>%
print_table_conditional()
LAST_DOWNLOAD |
---|
2024-10-09 |
LAST_COMPILE |
---|
2024-11-05 |
%>%
env_ac_tax group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
head(1) %>%
print_table_conditional()
time | Nobs |
---|---|
2022 | 620 |
%>%
env_ac_tax left_join(tax, by = "tax") %>%
group_by(tax, Tax) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional
tax | Tax | Nobs |
---|---|---|
ENV | Total environmental taxes | 4332 |
NRG | Energy taxes | 4332 |
TRA | Transport taxes | 4332 |
POL_RES | Taxes on Pollution/Resources | 4269 |
%>%
env_ac_tax left_join(unit, by = "unit") %>%
group_by(unit, Unit) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional
unit | Unit | Nobs |
---|---|---|
MIO_EUR | Million euro | 3501 |
MIO_NAC | Million units of national currency | 3501 |
PC_GDP | Percentage of gross domestic product (GDP) | 3447 |
PC_TSCO | Percentage of total revenues from taxes and social contributions (including imputed social contributions) | 3408 |
PC_TSCO_X_ISCO | Percentage of total revenues from taxes and social contributions (excluding imputed social contributions) | 3408 |
%>%
env_ac_tax 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 .} {
%>%
env_ac_tax filter(time == "2019",
== "PC_GDP") %>%
unit left_join(geo, by = "geo") %>%
left_join(tax, by = "tax") %>%
select(Geo, values, Tax) %>%
spread(Tax, values) %>%
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 .} {
%>%
env_ac_tax filter(geo %in% c("EL", "SE", "HR"),
== "PC_GDP",
unit == "NRG") %>%
tax %>%
year_to_date left_join(geo, by = "geo") %>%
mutate(values = values / 100) %>%
+ geom_line(aes(x = date, y = values, color = Geo)) +
ggplot theme_minimal() +
scale_x_date(breaks = as.Date(paste0(seq(1960, 2020, 5), "-01-01")),
labels = date_format("%y")) +
+
add_3flags scale_color_manual(values = c("#FF0000", "#0D5EAF", "#FECC00")) +
theme(legend.position = "none") +
xlab("") + ylab("Energy taxes (% of GDP)") +
scale_y_continuous(breaks = 0.01*seq(-30, 30, .2),
labels = percent_format(a = .1))