• 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

The uneven race to renewables

  • Show All Code
  • Hide All Code

  • View Source

Renewable share of electricity, 2000–2023 (selected countries)

30DayChartChallenge
Data Visualization
R Programming
2026
Renewable share of electricity from 2000 to 2023 across six countries. Denmark rises from 15% to 86% — the standout of the group. Norway holds steady near 99% as a benchmark ceiling. Australia, China, Poland, and India show modest, uneven progress. Built with R and Datawrapper as this challenge’s new tool entry.
Author

Steven Ponce

Published

April 22, 2026

Figure 1: Line chart showing the renewable share of electricity from 2000 to 2023 for six countries. Denmark rises sharply from 15% to 86%, the most dramatic increase. Norway remains a near-constant ceiling at 99%. Australia, China, and Poland show modest growth, ending between 27–35%. India grows slowly, reaching 19%. The chart illustrates the uneven pace of the global energy transition.

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
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 8,
  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

energy_raw <- 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(energy_raw)
```

4. Tidy Data

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

### |- define the 6 focal countries ----
focal_countries <- c(
  "Norway", "Denmark", "China", "India", "Poland", "Australia"
)

### |- filter: focal countries, 2000–2023, non-missing renewable share ----
renewables_long <- energy_raw |>
  filter(
    country %in% focal_countries,
    year >= 2000,
    year <= 2023,
    !is.na(renewables_share_elec)
  ) |>
  select(country, year, renewables_share_elec) |>
  mutate(
    renewables_share_elec = round(renewables_share_elec, 1)
  ) |>
  arrange(country, year)

## RESHAPE WIDE FOR DATAWRAPPER ----

# Datawrapper multi-line format:
#   - One column per series (country)
#   - One row per x-axis value (year)
#   - First column = Year (x-axis)
#
# Shape:
#   Year | Norway | Denmark | China | India | Poland | Australia

renewables_dw <- renewables_long |>
  pivot_wider(
    names_from  = country,
    values_from = renewables_share_elec
  ) |>
  rename(Year = year) |>
  # Column order: Year first, then countries roughly by 2023 share descending
  select(Year, Norway, Denmark, Australia, China, India, Poland)
```

5. Visualization Parameters

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

## ---- DATAWRAPPER SETUP NOTES ------------------------------------------------
##
## 1. Upload CSV
##    Dashboard > New Chart > Upload / paste CSV
##    File: dcc_2026_day22_renewables_long.csv
##
## 2. Chart type
##    Select: Lines (Multiple Lines if DW offers it)
##    X-axis = Year (auto-detected as numeric/date)
##    Each country column = one line
##
## 3. Refine tab — key settings
##    - Line labels: "Right" — shows country name at end of each line
##    - No legend needed if end-labels are on
##    - Y-axis: start at 0, max ~100 (or let DW auto-scale)
##    - X-axis: 2000 to 2023
##    - Consider: bold Denmark line to draw the eye to the transition star
##
## 4. Annotate tab
##    - Title: "Some countries surged. Others barely moved."
##      or: "The uneven race to renewables"
##    - Subtitle: "Renewable share of electricity, 2000–2023 (selected countries)"
##    - Source: Our World in Data / Ember
##    - Byline: Steven Ponce | #30DayChartChallenge 2026
##    - Consider: one annotation callout on Denmark's acceleration ~2008–2020
##
## 5. Publish > Export PNG for thumbnail
##    Save as: thumbnails/tt_30dcc_2026_22.png
##
## 6. Embed in .qmd
##    Copy the responsive iframe code from Publish tab
##    Paste inside a ```{=html} block in your Quarto file
```

6. Plot

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

### |- main plot ----
#   https://datawrapper.dwcdn.net/U969h/1/


## NOTE: Visualization handled entirely in Datawrapper (new tool).
##       This script handles reshaping and CSV export only.
##       Six countries chosen for maximum trajectory contrast:
##         Norway   — ceiling benchmark (~95% throughout)
##         Denmark  — dramatic rise, the transition star
##         China    — rising from a massive generation base
##         India    — modest rise, developing-world story
##         Poland   — low and slow, fossil fuel laggard
##         Australia — late mover, strong recent acceleration
```

7. Save

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

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

8. Session Info

TipExpand for Session Info

9. GitHub Repository

TipExpand for GitHub Repo

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

For the full repository, click here.

10. References

TipExpand for References
  1. Data Sources:
    • Hannah Ritchie, Pablo Rosado, and Max Roser (2023). Energy. Published online at OurWorldInData.org. Retrieved via Our World in Data GitHub repository. Series: Renewable share of electricity (%), 2000–2023. Countries: Norway, Denmark, Australia, China, Poland, India. https://github.com/owid/energy-data
  2. Tool:
    • Datawrapper (2026). Free tier. Chart type: Line chart. Visualization built and published at datawrapper.de. https://datawrapper.dwcdn.net/U969h/1/

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 = {The Uneven Race to Renewables},
  date = {2026-04-22},
  url = {https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_22.html},
  langid = {en}
}
For attribution, please cite this work as:
Ponce, Steven. 2026. “The Uneven Race to Renewables.” April 22, 2026. https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_22.html.
Source Code
---
title: "The uneven race to renewables"
subtitle: "Renewable share of electricity, 2000–2023 (selected countries)"
description: "Renewable share of electricity from 2000 to 2023 across six countries. Denmark rises from 15% to 86% — the standout of the group. Norway holds steady near 99% as a benchmark ceiling. Australia, China, Poland, and India show modest, uneven progress. Built with R and Datawrapper as this challenge's new tool entry."
date: "2026-04-22" 
author:
  - name: "Steven Ponce"
    url: "https://stevenponce.netlify.app"
citation:
  url: "https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_22.html"
categories: ["30DayChartChallenge", "Data Visualization", "R Programming", "2026"]
tags: [
  "30DayChartChallenge",
  "Timeseries",
  "New Tool",
  "Datawrapper",
  "Energy",
  "Renewables",
  "Electricity",
  "Line Chart",
  "Energy Transition",
  "Climate",
  "Our World in Data",
  "Denmark",
  "Multi-country"
]
image: "thumbnails/30dcc_2026_22.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
---

![Line chart showing the renewable share of electricity from 2000 to 2023 for six countries. Denmark rises sharply from 15% to 86%, the most dramatic increase. Norway remains a near-constant ceiling at 99%. Australia, China, and Poland show modest growth, ending between 27–35%. India grows slowly, reaching 19%. The chart illustrates the uneven pace of the global energy transition.](30dcc_2026_22.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
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 8,
  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

energy_raw <- 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(energy_raw)
```

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

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

### |- define the 6 focal countries ----
focal_countries <- c(
  "Norway", "Denmark", "China", "India", "Poland", "Australia"
)

### |- filter: focal countries, 2000–2023, non-missing renewable share ----
renewables_long <- energy_raw |>
  filter(
    country %in% focal_countries,
    year >= 2000,
    year <= 2023,
    !is.na(renewables_share_elec)
  ) |>
  select(country, year, renewables_share_elec) |>
  mutate(
    renewables_share_elec = round(renewables_share_elec, 1)
  ) |>
  arrange(country, year)

## RESHAPE WIDE FOR DATAWRAPPER ----

# Datawrapper multi-line format:
#   - One column per series (country)
#   - One row per x-axis value (year)
#   - First column = Year (x-axis)
#
# Shape:
#   Year | Norway | Denmark | China | India | Poland | Australia

renewables_dw <- renewables_long |>
  pivot_wider(
    names_from  = country,
    values_from = renewables_share_elec
  ) |>
  rename(Year = year) |>
  # Column order: Year first, then countries roughly by 2023 share descending
  select(Year, Norway, Denmark, Australia, China, India, Poland)
```


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

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

## ---- DATAWRAPPER SETUP NOTES ------------------------------------------------
##
## 1. Upload CSV
##    Dashboard > New Chart > Upload / paste CSV
##    File: dcc_2026_day22_renewables_long.csv
##
## 2. Chart type
##    Select: Lines (Multiple Lines if DW offers it)
##    X-axis = Year (auto-detected as numeric/date)
##    Each country column = one line
##
## 3. Refine tab — key settings
##    - Line labels: "Right" — shows country name at end of each line
##    - No legend needed if end-labels are on
##    - Y-axis: start at 0, max ~100 (or let DW auto-scale)
##    - X-axis: 2000 to 2023
##    - Consider: bold Denmark line to draw the eye to the transition star
##
## 4. Annotate tab
##    - Title: "Some countries surged. Others barely moved."
##      or: "The uneven race to renewables"
##    - Subtitle: "Renewable share of electricity, 2000–2023 (selected countries)"
##    - Source: Our World in Data / Ember
##    - Byline: Steven Ponce | #30DayChartChallenge 2026
##    - Consider: one annotation callout on Denmark's acceleration ~2008–2020
##
## 5. Publish > Export PNG for thumbnail
##    Save as: thumbnails/tt_30dcc_2026_22.png
##
## 6. Embed in .qmd
##    Copy the responsive iframe code from Publish tab
##    Paste inside a ```{=html} block in your Quarto file

```

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

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

### |- main plot ----
#   https://datawrapper.dwcdn.net/U969h/1/


## NOTE: Visualization handled entirely in Datawrapper (new tool).
##       This script handles reshaping and CSV export only.
##       Six countries chosen for maximum trajectory contrast:
##         Norway   — ceiling benchmark (~95% throughout)
##         Denmark  — dramatic rise, the transition star
##         China    — rising from a massive generation base
##         India    — modest rise, developing-world story
##         Poland   — low and slow, fossil fuel laggard
##         Australia — late mover, strong recent acceleration

```

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

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

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

#### [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_22.qmd`](https://github.com/poncest/personal-website/blob/master/data_visualizations/TidyTuesday/2026/30dcc_2026_22.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:**
   - Hannah Ritchie, Pablo Rosado, and Max Roser (2023). Energy.
     Published online at OurWorldInData.org.
     Retrieved via Our World in Data GitHub repository.
     Series: Renewable share of electricity (%), 2000–2023.
     Countries: Norway, Denmark, Australia, China, Poland, India.
     https://github.com/owid/energy-data

2. **Tool:**
   - Datawrapper (2026). Free tier. Chart type: Line chart.
     Visualization built and published at datawrapper.de.
     https://datawrapper.dwcdn.net/U969h/1/
:::


#### [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