title: “Emissions and Energy Use” output: flexdashboard::flex_dashboard: orientation: rows vertical_layout: fill —

Marwan Kenawy

Chart A

GHG Emissions Over Time

top5 <- c("United States", "China", "India", "Russia", "Japan")

energy %>%
  filter(country %in% top5, year >= 1980, !is.na(greenhouse_gas_emissions)) %>%
  ggplot(aes(x = year, y = greenhouse_gas_emissions, color = country)) +
  geom_line(size = 1.2) +
  labs(
    title = "GHG Emissions Over Time",
    x = "Year",
    y = "Greenhouse Gas Emissions"
  ) +
  theme_minimal() 
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

  • This line chart shows the total greenhouse gas emissions from 1980 to 2020 for five major countries.

  • China’s emissions have surged since the early 2000s, surpassing the U.S. to become the largest emitter.

  • The United States peaked around 2005 and has shown a slow decline since.

  • India is steadily rising as it industrializes and expands its energy needs.

  • Russia’s emissions fell dramatically in the early 1990s.

  • Japan has remained relatively stable with only slight fluctuations.

  • This chart gives a clear picture of long-term emissions growth and economic development.


Chart B

Boxplot: GHG Emissions Distribution by Country (1980–2020)

top5 <- c("United States", "China", "India", "Russia", "Japan")

energy %>%
  filter(country %in% top5, year >= 1980, !is.na(greenhouse_gas_emissions)) %>%
  ggplot(aes(x = country, y = greenhouse_gas_emissions, fill = country)) +
  geom_boxplot(alpha = 0.7) +
  labs(
    title = "Distribution of GHG Emissions (1980–2020)",
    x = "Country",
    y = "GHG Emissions (tons CO₂e)"
  ) +
  theme_minimal()

  • This boxplot shows the distribution of greenhouse gas emissions from 1980 to 2020 for each of the top five countries.

  • China has a wide range, reflecting rapid growth and variability in its emissions over the past two decades.

  • The U.S. shows high and consistent emissions, with less variation across years.

  • India has lower emissions, but the box shows a clear upward shift over time.

  • Russia’s distribution shows a sharp drop in emissions in the early 1990s.

  • Japan shows a narrower and more stable range, with less fluctuation.

  • This visualization makes it easy to compare not just the average emissions of each country, but also their volatility and change over time.

Chart C

Renewable Energy Share by Country (2020)

energy %>%
  filter(year == 2020, country %in% top5, !is.na(renewables_share_energy)) %>%
  ggplot(aes(x = reorder(country, renewables_share_energy), y = renewables_share_energy, fill = country)) +
  geom_col() +
  coord_flip() +
  labs(
    title = "Renewable Energy Share by Country (2020)",
    x = "Country",
    y = "Renewable Share (%)"
  ) +
  theme_minimal()

  • This bar chart shows how much of each country’s energy came from renewable sources in 2020.

  • India and China are increasing renewables rapidly due to growing demand and national climate policies.

  • The U.S. and Japan are in a slower but steady transition.

  • Russia has made very little progress and remains heavily reliant on fossil fuels.

  • The chart reflects the urgency and variation in how different nations are investing in clean energy.

Chart D

Energy Use per Capita Over Time

energy %>%
  filter(country %in% top5, year >= 1980, !is.na(energy_per_capita)) %>%
  ggplot(aes(x = year, y = energy_per_capita, color = country)) +
  geom_line(size = 1.2) +
  labs(
    title = "Energy Use per Capita Over Time (1980–2020)",
    x = "Year",
    y = "Energy Use per Capita (kWh/person)"
  ) +
  theme_minimal()

  • This line chart shows how the average amount of energy used per person has changed from 1980 to 2020 in five major countries.

  • The United States and Russia have consistently had the highest energy use per person, reflecting more energy intensive lifestyles and industries.

  • China and India have shown sharp increases in recent decades as their economies grew and access to energy expanded.

  • Japan has remained relatively stable, which may reflect energy efficiency and efforts.

  • The chart helps us understand how development, population growth, and economic activity affect energy consumption patterns over time.

Chart E

GHG Emissions Per Capita Over Time (Faceted by Country)

# Make sure per capita variable exists
energy <- energy %>%
  mutate(ghg_per_capita = greenhouse_gas_emissions / population)

energy %>%
  filter(country %in% top5, year >= 1980, !is.na(ghg_per_capita)) %>%
  ggplot(aes(x = year, y = ghg_per_capita)) +
  geom_line(color = "steelblue", size = 1.2) +
  facet_wrap(~ country, scales = "free_y") +
  labs(
    title = "GHG Emissions Per Capita Over Time",
    x = "Year",
    y = "GHG Emissions per Person (tons CO₂e)"
  ) +
  theme_minimal()

  • Each chart shows the greenhouse gas emissions per person over time for a specific country.

  • The U.S. has the highest per-capita emissions and has stayed mostly stable.

  • China’s per-person emissions increased sharply in the 2000s.

  • India shows a slow and steady rise from a very low base.

  • Russia and Japan have fluctuated slightly but remain well above global average levels.

  • These country-specific charts highlight how emissions patterns differ even when total emissions may look similar.

Chart F

Renewable Energy Share Over Time

energy %>%
  filter(country %in% top5, year >= 2000, !is.na(renewables_share_energy)) %>%
  ggplot(aes(x = year, y = renewables_share_energy, color = country)) +
  geom_line(size = 1.2) +
  labs(
    title = "Renewables Share of Energy Over Time (2000–2020)",
    x = "Year",
    y = "Renewables Share (%)"
  ) +
  theme_minimal()

  • This line chart shows how the percentage of total energy coming from renewable sources has changed from 2000 to 2020 in five key countries.

  • India and China have made the fastest progress, expanding their renewable energy sectors and reducing their reliance on fossil fuels.

  • The United States and Japan have seen slight increases, reflecting a steady but slower energy transition.

  • Russia shows little to no progress, with renewable energy remaining a very small part of its energy mix.

  • This chart highlights how each country is approaching the shift toward cleaner energy, revealing differences in pace, policy, and priorities.