• Steven Ponce
  • About
  • Data Visualizations
  • Projects
  • Resume
  • Email

On this page

  • Steps to Create this Graphic
    • 1. Load Packages & Setup
    • 2. Read in the Data
    • 3. Examine the Data
    • 4. Tidy Data
    • 5. Visualization Parameters
    • 6. Plot
    • 7. Save
    • 8. Session Info
    • 9. GitHub Repository
    • 10. References
    • 11. Custom Functions Documentation

Energy Transitions Are Not Smooth

  • Show All Code
  • Hide All Code

  • View Source

Year-over-year change in renewable electricity share (percentage points), 1991–2023. Frequent reversals and uneven gains reveal how unpredictable the path to clean energy can be.

30DayChartChallenge
Data Visualization
R Programming
2026
A faceted bar chart examining year-over-year volatility in renewable electricity share across five countries from 1991 to 2023. Five transition archetypes — selected to contrast stable versus volatile paths — reveal that even countries making real progress experience frequent reversals. Built with ggplot2 using diverging color encoding and small multiples to make instability immediately legible across panels.
Author

Steven Ponce

Published

April 27, 2026

Figure 1: A faceted bar chart showing year-over-year changes in the share of renewable electricity (in percentage points) for five countries from 1991 to 2023. Each panel displays one country — Denmark (Wind-driven volatility), Brazil (Gradual mover), Germany (Managed transition), Spain (Boom & reversal), and Australia (Political whipsaw). Blue bars indicate years of renewable growth; burgundy bars indicate reversals. Denmark shows large wind-driven swings despite an upward trend. Brazil and Spain display frequent deep reversals. Germany shows a steady, controlled climb with few setbacks. Australia shows small, inconsistent gains. The zero reference line anchors each panel, making instability immediately visible across all five transition paths.

Steps to Create this Graphic

1. Load Packages & Setup

Show code
```{r}
#| label: load
#| warning: false
#| message: false      
#| results: "hide"     

## 1. LOAD PACKAGES & SETUP ----
suppressPackageStartupMessages({
pacman::p_load(
  tidyverse, ggtext, showtext, 
  janitor, scales, glue, here
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 7,
  units  = "in",
  dpi    = 320
)

# Source utility functions
suppressMessages(source(here::here("R/utils/fonts.R")))
source(here::here("R/utils/social_icons.R"))
source(here::here("R/utils/image_utils.R"))
source(here::here("R/themes/base_theme.R"))
```

2. Read in the Data

Show code
```{r}
#| label: read
#| include: true
#| eval: true
#| warning: false

### |- observed CO₂: read from local cache ----
raw_data <- read_csv(
  here::here("data/30DayChartChallenge/2026/owid-energy-data.csv"),
  show_col_types = FALSE
)
```

3. Examine the Data

Show code
```{r}
#| label: examine
#| include: true
#| eval: true
#| results: 'hide'
#| warning: false

glimpse(raw_data)
```

4. Tidy Data

Show code
```{r}
#| label: tidy
#| warning: false

selected_countries <- c(
  "Denmark",
  "Brazil",
  "Germany",
  "Spain",
  "Australia"
)

# Archetype labels —
archetype_map <- tribble(
  ~country,    ~archetype,                ~profile,
  "Denmark",   "Wind-driven volatility",  "moderate",
  "Brazil",    "Gradual mover",           "smooth",
  "Germany",   "Managed transition",      "moderate",
  "Spain",     "Boom & reversal",         "volatile",
  "Australia", "Political whipsaw",       "volatile"
)

### |- filter and compute delta ----
df_clean <- raw_data |>
  filter(
    country %in% selected_countries,
    year >= 1991,          
    year <= 2023
  ) |>
  select(country, year, renewables_share_elec) |>
  mutate(renewables_share_elec = as.numeric(renewables_share_elec)) |>
  filter(!is.na(renewables_share_elec)) |>
  arrange(country, year) |>
  group_by(country) |>
  mutate(
    delta_renew = renewables_share_elec - lag(renewables_share_elec)
  ) |>
  filter(!is.na(delta_renew)) |>
  ungroup()

### |- join archetype metadata ----
df_plot <- df_clean |>
  left_join(archetype_map, by = "country") |>
  mutate(
    country = factor(country, levels = c(
      "Denmark", "Brazil", "Germany", "Spain", "Australia"
    )),
    # direction for coloring bars/fill
    direction = if_else(delta_renew >= 0, "positive", "negative")
  )

### |- per-country volatility stats (for annotation) ----
df_stats <- df_plot |>
  group_by(country, archetype, profile) |>
  summarise(
    sd_delta  = round(sd(delta_renew, na.rm = TRUE), 1),
    mean_delta = round(mean(delta_renew, na.rm = TRUE), 1),
    n_negative = sum(delta_renew < 0),
    .groups = "drop"
  )

### |- strip label: country + archetype ----
strip_labels <- archetype_map |>
  mutate(label = paste0(country, "\n", archetype)) |>
  select(country, label) |>
  deframe()

### |- volatility annotation per panel ----
df_annot <- df_stats |>
  mutate(
    label = paste0("SD = ", sd_col <- sd_delta, " pp"),
    x_pos = 2022,
    y_pos = Inf
  )
```

5. Visualization Parameters

Show code
```{r}
#| label: params
#| include: true
#| warning: false

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    "background" = "#F5F3EE",
    "text"       = "#2C2C2C",
    "subtext"    = "#5C5C5C",
    "grid"       = "#E8E5DF",
    "positive"   = "#2E6B9E",  
    "negative"   = "#8B3030",   
    "zero_line"  = "#9A9591"     
  )
)

bg_col       <- colors$palette$background
text_col     <- colors$palette$text
sub_col      <- colors$palette$subtext
grid_col     <- colors$palette$grid
pos_col      <- colors$palette$positive
neg_col      <- colors$palette$negative
zero_col     <- colors$palette$zero_line

### |- titles and caption ----
title_text    <- "Energy Transitions Are Not Smooth"

subtitle_text <- paste0(
  "Year-over-year change in renewable electricity share (percentage points), 1991–2023.<br>",
  "Frequent reversals and uneven gains reveal how unpredictable the path to clean energy can be."
)
caption_text  <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 27,
  source_text = "Our World in Data | Energy Mix"
)

### |- fonts ----
setup_fonts()
fonts <- get_font_families()

### |- base theme ----
base_theme <- create_base_theme(colors)

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    plot.background = element_rect(fill = bg_col, color = NA),
    panel.background = element_rect(fill = bg_col, color = NA),

    # minimal grid — only horizontal reference
    panel.grid.major.y = element_line(color = grid_col, linewidth = 0.3),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),

    # facet strips — country name + archetype label
    strip.background = element_rect(fill = bg_col, color = NA),
    strip.text = element_text(
      family = fonts$text,
      face = "bold",
      size = 9,
      color = text_col,
      hjust = 0,
      margin = margin(b = 4)
    ),

    # axes
    axis.title = element_text(color = sub_col, size = 9, family = fonts$text),
    axis.text.x = element_text(color = sub_col, size = 7.5, family = fonts$text),
    axis.text.y = element_text(color = sub_col, size = 7.5, family = fonts$text),
    axis.ticks = element_blank(),

    # panel spacing
    panel.spacing.x = unit(1.2, "lines"),
    plot.title = element_text(
      family = fonts$title, face = "bold",
      size = 18, color = text_col,
      margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text, size = 9.5, color = sub_col,
      lineheight = 1.45, margin = margin(b = 14)
    ),
    plot.caption = element_markdown(
      family = fonts$text, size = 7.5, color = sub_col,
      hjust = 0, margin = margin(t = 12)
    ),
    plot.margin = margin(20, 20, 14, 20)
  )
)

theme_set(weekly_theme)
```

6. Plot

Show code
```{r}
#| label: plot
#| warning: false

### |- main plot ----
p <- ggplot(df_plot, aes(x = year, y = delta_renew)) +

  # Geoms
  geom_hline(
    yintercept = 0,
    color      = zero_col,
    linewidth  = 0.6,
    linetype   = "solid"
  ) +
  geom_col(
    aes(fill = direction),
    width = 0.75
  ) +

  # Facet
  facet_wrap(
    ~country,
    nrow     = 1,
    labeller = labeller(country = strip_labels)
  ) +

  # Scales
  scale_fill_manual(
    values = c("positive" = pos_col, "negative" = neg_col)
  ) +
  scale_x_continuous(
    breaks = c(2000, 2010, 2020),
    labels = c("2000", "'10", "'20")
  ) +
  scale_y_continuous(
    name   = "Δ Renewable share (pp)",
    labels = label_number(suffix = "pp", style_positive = "plus")
  ) +
  guides(fill = "none") +

  # Labs
  labs(
    title    = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    x        = NULL
  )
```

7. Save

Show code
```{r}
#| label: save
#| warning: false

### |-  plot image ----  
save_plot(
  p,
  type = "30daychartchallenge",
  year = 2026,
  day = 27,
  width = 10,
  height = 7
  )
```

8. Session Info

TipExpand for Session Info
R version 4.5.3 (2026-03-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] here_1.0.2      glue_1.8.0      scales_1.4.0    janitor_2.2.1  
 [5] showtext_0.9-8  showtextdb_3.0  sysfonts_0.8.9  ggtext_0.1.2   
 [9] lubridate_1.9.5 forcats_1.0.1   stringr_1.6.0   dplyr_1.2.1    
[13] purrr_1.2.2     readr_2.2.0     tidyr_1.3.2     tibble_3.3.1   
[17] ggplot2_4.0.3   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] gtable_0.3.6       xfun_0.57          htmlwidgets_1.6.4  tzdb_0.5.0        
 [5] vctrs_0.7.3        tools_4.5.3        generics_0.1.4     curl_7.0.0        
 [9] parallel_4.5.3     gifski_1.32.0-2    pacman_0.5.1       pkgconfig_2.0.3   
[13] RColorBrewer_1.1-3 S7_0.2.1           lifecycle_1.0.5    compiler_4.5.3    
[17] farver_2.1.2       textshaping_1.0.5  codetools_0.2-20   snakecase_0.11.1  
[21] litedown_0.9       htmltools_0.5.9    yaml_2.3.12        pillar_1.11.1     
[25] crayon_1.5.3       camcorder_0.1.0    magick_2.9.1       commonmark_2.0.0  
[29] tidyselect_1.2.1   digest_0.6.39      stringi_1.8.7      labeling_0.4.3    
[33] rsvg_2.7.0         rprojroot_2.1.1    fastmap_1.2.0      grid_4.5.3        
[37] cli_3.6.6          magrittr_2.0.5     withr_3.0.2        bit64_4.6.0-1     
[41] timechange_0.4.0   rmarkdown_2.31     bit_4.6.0          otel_0.2.0        
[45] ragg_1.5.2         hms_1.1.4          evaluate_1.0.5     knitr_1.51        
[49] markdown_2.0       rlang_1.2.0        gridtext_0.1.6     Rcpp_1.1.1        
[53] xml2_1.5.2         svglite_2.2.2      rstudioapi_0.18.0  vroom_1.7.1       
[57] jsonlite_2.0.0     R6_2.6.1           systemfonts_1.3.2 

9. GitHub Repository

TipExpand for GitHub Repo

The complete code for this analysis is available in 30dcc_2026_27.qmd.

For the full repository, click here.

10. References

TipExpand for References
  1. Data Sources:
    • Ritchie, H., Rosado, P., & Roser, M. (2024). Energy Mix. Our World in Data. Retrieved from: https://ourworldindata.org/energy-mix
    • Underlying data: Our World in Data Energy Dataset (owid-energy-data.csv). Retrieved from: https://github.com/owid/energy-data

11. Custom Functions Documentation

Note📦 Custom Helper Functions

This analysis uses custom functions from my personal module library for efficiency and consistency across projects.

Functions Used:

  • fonts.R: setup_fonts(), get_font_families() - Font management with showtext
  • social_icons.R: create_social_caption() - Generates formatted social media captions
  • image_utils.R: save_plot() - Consistent plot saving with naming conventions
  • base_theme.R: create_base_theme(), extend_weekly_theme(), get_theme_colors() - Custom ggplot2 themes

Why custom functions?
These utilities standardize theming, fonts, and output across all my data visualizations. The core analysis (data tidying and visualization logic) uses only standard tidyverse packages.

Source Code:
View all custom functions → GitHub: R/utils

Back to top

Citation

BibTeX citation:
@online{ponce2026,
  author = {Ponce, Steven},
  title = {Energy {Transitions} {Are} {Not} {Smooth}},
  date = {2026-04-27},
  url = {https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_27.html},
  langid = {en}
}
For attribution, please cite this work as:
Ponce, Steven. 2026. “Energy Transitions Are Not Smooth.” April 27, 2026. https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_27.html.
Source Code
---
title: "Energy Transitions Are Not Smooth"
subtitle: "Year-over-year change in renewable electricity share (percentage points), 1991–2023. Frequent reversals and uneven gains reveal how unpredictable the path to clean energy can be."
description: "A faceted bar chart examining year-over-year volatility in renewable electricity share across five countries from 1991 to 2023. Five transition archetypes — selected to contrast stable versus volatile paths — reveal that even countries making real progress experience frequent reversals. Built with ggplot2 using diverging color encoding and small multiples to make instability immediately legible across panels."
date: "2026-04-27" 
author:
  - name: "Steven Ponce"
    url: "https://stevenponce.netlify.app"
citation:
  url: "https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_27.html"
categories: ["30DayChartChallenge", "Data Visualization", "R Programming", "2026"]
tags: [
  "30DayChartChallenge",
  "Uncertainties",
  "Animation",
  "Energy Transition",
  "Renewable Energy",
  "Faceted Chart",
  "Bar Chart",
  "Small Multiples",
  "Time Series",
  "Volatility",
  "Climate",
  "OWID",
  "ggplot2"
]
image: "thumbnails/30dcc_2026_27.png"
format:
  html:
    toc: true
    toc-depth: 5
    code-link: true
    code-fold: true
    code-tools: true
    code-summary: "Show code"
    self-contained: true
    theme: 
      light: [flatly, assets/styling/custom_styles.scss]
      dark: [darkly, assets/styling/custom_styles_dark.scss]
editor_options: 
  chunk_output_type: inline
execute: 
  freeze: true                                                  
  cache: true                                                   
  error: false
  message: false
  warning: false
  eval: true
---

![A faceted bar chart showing year-over-year changes in the share of renewable electricity (in percentage points) for five countries from 1991 to 2023. Each panel displays one country — Denmark (Wind-driven volatility), Brazil (Gradual mover), Germany (Managed transition), Spain (Boom & reversal), and Australia (Political whipsaw). Blue bars indicate years of renewable growth; burgundy bars indicate reversals. Denmark shows large wind-driven swings despite an upward trend. Brazil and Spain display frequent deep reversals. Germany shows a steady, controlled climb with few setbacks. Australia shows small, inconsistent gains. The zero reference line anchors each panel, making instability immediately visible across all five transition paths.](30dcc_2026_27.png){#fig-1}

### [**Steps to Create this Graphic**]{.mark}

#### [1. Load Packages & Setup]{.smallcaps}

```{r}
#| label: load
#| warning: false
#| message: false      
#| results: "hide"     

## 1. LOAD PACKAGES & SETUP ----
suppressPackageStartupMessages({
pacman::p_load(
  tidyverse, ggtext, showtext, 
  janitor, scales, glue, here
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 7,
  units  = "in",
  dpi    = 320
)

# Source utility functions
suppressMessages(source(here::here("R/utils/fonts.R")))
source(here::here("R/utils/social_icons.R"))
source(here::here("R/utils/image_utils.R"))
source(here::here("R/themes/base_theme.R"))
```

#### [2. Read in the Data]{.smallcaps}

```{r}
#| label: read
#| include: true
#| eval: true
#| warning: false

### |- observed CO₂: read from local cache ----
raw_data <- read_csv(
  here::here("data/30DayChartChallenge/2026/owid-energy-data.csv"),
  show_col_types = FALSE
)

```

#### [3. Examine the Data]{.smallcaps}

```{r}
#| label: examine
#| include: true
#| eval: true
#| results: 'hide'
#| warning: false

glimpse(raw_data)
```

#### [4. Tidy Data]{.smallcaps}

```{r}
#| label: tidy
#| warning: false

selected_countries <- c(
  "Denmark",
  "Brazil",
  "Germany",
  "Spain",
  "Australia"
)

# Archetype labels —
archetype_map <- tribble(
  ~country,    ~archetype,                ~profile,
  "Denmark",   "Wind-driven volatility",  "moderate",
  "Brazil",    "Gradual mover",           "smooth",
  "Germany",   "Managed transition",      "moderate",
  "Spain",     "Boom & reversal",         "volatile",
  "Australia", "Political whipsaw",       "volatile"
)

### |- filter and compute delta ----
df_clean <- raw_data |>
  filter(
    country %in% selected_countries,
    year >= 1991,          
    year <= 2023
  ) |>
  select(country, year, renewables_share_elec) |>
  mutate(renewables_share_elec = as.numeric(renewables_share_elec)) |>
  filter(!is.na(renewables_share_elec)) |>
  arrange(country, year) |>
  group_by(country) |>
  mutate(
    delta_renew = renewables_share_elec - lag(renewables_share_elec)
  ) |>
  filter(!is.na(delta_renew)) |>
  ungroup()

### |- join archetype metadata ----
df_plot <- df_clean |>
  left_join(archetype_map, by = "country") |>
  mutate(
    country = factor(country, levels = c(
      "Denmark", "Brazil", "Germany", "Spain", "Australia"
    )),
    # direction for coloring bars/fill
    direction = if_else(delta_renew >= 0, "positive", "negative")
  )

### |- per-country volatility stats (for annotation) ----
df_stats <- df_plot |>
  group_by(country, archetype, profile) |>
  summarise(
    sd_delta  = round(sd(delta_renew, na.rm = TRUE), 1),
    mean_delta = round(mean(delta_renew, na.rm = TRUE), 1),
    n_negative = sum(delta_renew < 0),
    .groups = "drop"
  )

### |- strip label: country + archetype ----
strip_labels <- archetype_map |>
  mutate(label = paste0(country, "\n", archetype)) |>
  select(country, label) |>
  deframe()

### |- volatility annotation per panel ----
df_annot <- df_stats |>
  mutate(
    label = paste0("SD = ", sd_col <- sd_delta, " pp"),
    x_pos = 2022,
    y_pos = Inf
  )
```


#### [5. Visualization Parameters]{.smallcaps}

```{r}
#| label: params
#| include: true
#| warning: false

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    "background" = "#F5F3EE",
    "text"       = "#2C2C2C",
    "subtext"    = "#5C5C5C",
    "grid"       = "#E8E5DF",
    "positive"   = "#2E6B9E",  
    "negative"   = "#8B3030",   
    "zero_line"  = "#9A9591"     
  )
)

bg_col       <- colors$palette$background
text_col     <- colors$palette$text
sub_col      <- colors$palette$subtext
grid_col     <- colors$palette$grid
pos_col      <- colors$palette$positive
neg_col      <- colors$palette$negative
zero_col     <- colors$palette$zero_line

### |- titles and caption ----
title_text    <- "Energy Transitions Are Not Smooth"

subtitle_text <- paste0(
  "Year-over-year change in renewable electricity share (percentage points), 1991–2023.<br>",
  "Frequent reversals and uneven gains reveal how unpredictable the path to clean energy can be."
)
caption_text  <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 27,
  source_text = "Our World in Data | Energy Mix"
)

### |- fonts ----
setup_fonts()
fonts <- get_font_families()

### |- base theme ----
base_theme <- create_base_theme(colors)

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    plot.background = element_rect(fill = bg_col, color = NA),
    panel.background = element_rect(fill = bg_col, color = NA),

    # minimal grid — only horizontal reference
    panel.grid.major.y = element_line(color = grid_col, linewidth = 0.3),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),

    # facet strips — country name + archetype label
    strip.background = element_rect(fill = bg_col, color = NA),
    strip.text = element_text(
      family = fonts$text,
      face = "bold",
      size = 9,
      color = text_col,
      hjust = 0,
      margin = margin(b = 4)
    ),

    # axes
    axis.title = element_text(color = sub_col, size = 9, family = fonts$text),
    axis.text.x = element_text(color = sub_col, size = 7.5, family = fonts$text),
    axis.text.y = element_text(color = sub_col, size = 7.5, family = fonts$text),
    axis.ticks = element_blank(),

    # panel spacing
    panel.spacing.x = unit(1.2, "lines"),
    plot.title = element_text(
      family = fonts$title, face = "bold",
      size = 18, color = text_col,
      margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text, size = 9.5, color = sub_col,
      lineheight = 1.45, margin = margin(b = 14)
    ),
    plot.caption = element_markdown(
      family = fonts$text, size = 7.5, color = sub_col,
      hjust = 0, margin = margin(t = 12)
    ),
    plot.margin = margin(20, 20, 14, 20)
  )
)

theme_set(weekly_theme)
```

#### [6. Plot]{.smallcaps}

```{r}
#| label: plot
#| warning: false

### |- main plot ----
p <- ggplot(df_plot, aes(x = year, y = delta_renew)) +

  # Geoms
  geom_hline(
    yintercept = 0,
    color      = zero_col,
    linewidth  = 0.6,
    linetype   = "solid"
  ) +
  geom_col(
    aes(fill = direction),
    width = 0.75
  ) +

  # Facet
  facet_wrap(
    ~country,
    nrow     = 1,
    labeller = labeller(country = strip_labels)
  ) +

  # Scales
  scale_fill_manual(
    values = c("positive" = pos_col, "negative" = neg_col)
  ) +
  scale_x_continuous(
    breaks = c(2000, 2010, 2020),
    labels = c("2000", "'10", "'20")
  ) +
  scale_y_continuous(
    name   = "Δ Renewable share (pp)",
    labels = label_number(suffix = "pp", style_positive = "plus")
  ) +
  guides(fill = "none") +

  # Labs
  labs(
    title    = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    x        = NULL
  )
```

#### [7. Save]{.smallcaps}

```{r}
#| label: save
#| warning: false

### |-  plot image ----  
save_plot(
  p,
  type = "30daychartchallenge",
  year = 2026,
  day = 27,
  width = 10,
  height = 7
  )
```

#### [8. Session Info]{.smallcaps}

::: {.callout-tip collapse="true"}
##### Expand for Session Info

```{r, echo = FALSE}
#| eval: true
#| warning: false

sessionInfo()
```
:::

#### [9. GitHub Repository]{.smallcaps} 

::: {.callout-tip collapse="true"}
##### Expand for GitHub Repo

The complete code for this analysis is available in [`30dcc_2026_27.qmd`](https://github.com/poncest/personal-website/blob/master/data_visualizations/TidyTuesday/2026/30dcc_2026_27.qmd).

For the full repository, [click here](https://github.com/poncest/personal-website/).
:::


#### [10. References]{.smallcaps}
::: {.callout-tip collapse="true"}
##### Expand for References
1. **Data Sources:**
   - Ritchie, H., Rosado, P., & Roser, M. (2024). *Energy Mix.*
     Our World in Data. Retrieved from: https://ourworldindata.org/energy-mix
   - Underlying data: Our World in Data Energy Dataset (owid-energy-data.csv).
     Retrieved from: https://github.com/owid/energy-data
:::


#### [11. Custom Functions Documentation]{.smallcaps}

::: {.callout-note collapse="true"}
##### 📦 Custom Helper Functions

This analysis uses custom functions from my personal module library for efficiency and consistency across projects.

**Functions Used:**

-   **`fonts.R`**: `setup_fonts()`, `get_font_families()` - Font management with showtext
-   **`social_icons.R`**: `create_social_caption()` - Generates formatted social media captions
-   **`image_utils.R`**: `save_plot()` - Consistent plot saving with naming conventions
-   **`base_theme.R`**: `create_base_theme()`, `extend_weekly_theme()`, `get_theme_colors()` - Custom ggplot2 themes

**Why custom functions?**\
These utilities standardize theming, fonts, and output across all my data visualizations. The core analysis (data tidying and visualization logic) uses only standard tidyverse packages.

**Source Code:**\
View all custom functions → [GitHub: R/utils](https://github.com/poncest/personal-website/tree/master/R)
:::

© 2024 Steven Ponce

Source Issues