tibble(DOWNLOAD_TIME = as.Date(file.info("~/Dropbox/website/data/wdi/EN.ATM.GHGT.KT.CE.RData")$mtime)) %>%
print_table_conditional()
DOWNLOAD_TIME |
---|
2022-09-27 |
EN.ATM.GHGT.KT.CE %>%
left_join(iso2c, by = "iso2c") %>%
group_by(iso2c, Iso2c) %>%
rename(value = `EN.ATM.GHGT.KT.CE`) %>%
mutate(value = round(value, 2)) %>%
summarise(Nobs = n(),
`Year 1` = first(year),
`CO2 emissions (kt) 1` = first(value),
`Year 2` = last(year),
`CO2 emissions (kt) 2` = last(value)) %>%
arrange(-`CO2 emissions (kt) 2`) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(Iso2c)),
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 .}
EN.ATM.GHGT.KT.CE %>%
right_join(iso2c, by = "iso2c") %>%
filter(iso2c %in% c("1W", "US", "CN", "EU")) %>%
group_by(year) %>%
mutate(value = EN.ATM.GHGT.KT.CE/EN.ATM.GHGT.KT.CE[iso2c == "1W"]) %>%
year_to_date %>%
filter(!(iso2c == "1W")) %>%
mutate(Iso2c = ifelse(iso2c == "EU", "Europe", Iso2c)) %>%
left_join(colors, by = c("Iso2c" = "country")) %>%
mutate(color = ifelse(iso2c == "US", color2, color)) %>%
ggplot(.) + theme_minimal() + scale_color_identity() +
geom_line(aes(x = date, y = value, color = color)) +
add_3flags +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(0, 70, 5),
labels = scales::percent_format(accuracy = 1),
limits = 0.01*c(0, 35)) +
xlab("") + ylab("Total greenhouse gas emissions (kt of CO2 equivalent)")
EN.ATM.GHGT.KT.CE %>%
right_join(iso2c, by = "iso2c") %>%
filter(iso2c %in% c("US", "CN", "EU")) %>%
mutate(value = EN.ATM.GHGT.KT.CE / 1000) %>%
year_to_date %>%
mutate(Iso2c = ifelse(iso2c == "EU", "Europe", Iso2c)) %>%
left_join(colors, by = c("Iso2c" = "country")) %>%
mutate(color = ifelse(iso2c == "US", color2, color)) %>%
ggplot(.) + theme_minimal() + scale_color_identity() +
geom_line(aes(x = date, y = value, color = color)) +
add_3flags +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
xlab("") + ylab("Emissions de CO2 en Mt") +
scale_y_continuous(breaks = seq(0, 100000, 1000),
labels = dollar_format(prefix = "", suffix = " Mt"))
EN.ATM.GHGT.KT.CE %>%
right_join(iso2c, by = "iso2c") %>%
filter(iso2c %in% c("1W", "IT", "FR", "DE")) %>%
group_by(year) %>%
mutate(value = EN.ATM.GHGT.KT.CE/EN.ATM.GHGT.KT.CE[iso2c == "1W"]) %>%
year_to_date %>%
filter(!(iso2c == "1W")) %>%
left_join(colors, by = c("Iso2c" = "country")) %>%
mutate(color = ifelse(iso2c == "US", color2, color)) %>%
ggplot(.) + theme_minimal() + scale_color_identity() +
geom_line(aes(x = date, y = value, color = color)) +
add_3flags +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(0, 70, 1),
labels = scales::percent_format(accuracy = 1),
limits = 0.01*c(0, 5)) +
xlab("") + ylab("Total greenhouse gas emissions (kt of CO2 equivalent)")
EN.ATM.GHGT.KT.CE %>%
filter(iso2c %in% c("IT", "FR", "DE")) %>%
left_join(iso2c, by = "iso2c") %>%
mutate(value = EN.ATM.GHGT.KT.CE / 1000) %>%
year_to_date %>%
mutate(Iso2c = ifelse(iso2c == "EU", "Europe", Iso2c)) %>%
left_join(colors, by = c("Iso2c" = "country")) %>%
mutate(color = ifelse(iso2c == "US", color2, color)) %>%
ggplot(.) + theme_minimal() + scale_color_identity() +
geom_line(aes(x = date, y = value, color = color)) +
add_3flags +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
xlab("") + ylab("Emissions de CO2 en Mt") +
scale_y_continuous(breaks = seq(0, 100000, 100),
labels = dollar_format(prefix = "", suffix = " Mt"))