Intro Thoughts
Status Quo
library(tidyverse)
emissions <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-05-21/emissions.csv')
## Rows: 12551 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (4): parent_entity, parent_type, commodity, production_unit
## dbl (3): year, production_value, total_emissions_MtCO2e
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
options(scipen = 10)
emissions %>%
group_by(parent_entity, year) %>%
summarise(total_emissions_MtCO2e = sum(total_emissions_MtCO2e)) %>%
mutate(cummulative = cumsum(total_emissions_MtCO2e)) %>%
# arrange(-total_cum) %>%
ggplot() +
aes(year, cummulative) +
geom_line(color = "grey") +
aes(group = parent_entity) +
scale_y_log10() +
NULL
## `summarise()` has grouped output by 'parent_entity'. You can override using the
## `.groups` argument.
last_plot() +
geom_line(data = . %>%
filter(parent_entity %in%
c("Abu Dhabi National Oil Company",
"Adani Enterprises",
"Adaro Energy")),
aes(color = parent_entity),
linewidth = 2)
last_plot() +
aes(id = paste(parent_entity, year)) + ggcallout:::geom_labellink_swss(which_id = "Adaro Energy 1992",
link_prop = .25)
last_plot() +
guides(color = "none") +
ggcallout:::geom_labellink_nww(which_id = "Abu Dhabi National Oil Company 1976",
link_prop = .3) +
ggcallout:::geom_labellink_south(which_id = "Adani Enterprises 2012",
link_prop = .2) +
aes(label = parent_entity %>% str_wrap(12)) +
labs(x = NULL)
Experiment