Electric vs Gasoline Cars: A Decade of Change

Syed Akram Syed Mahamood - s4075880

Introduction

  • In the past decade, there’s been a big shift in the car industry from petrol vehicles to electric ones.
  • In this presentation, I’m going to compare EVs and gasoline cars based on sales, emissions, and fuel efficiency.
  • All data used comes from publicly available open sources which are listed at the end.

Global EV vs Gasoline Sales (2013–2023) - Line Graph

library(ggplot2)
library(readr)
library(dplyr)

sales_data <- read_csv("ev_vs_gasoline_sales.csv")

ggplot(sales_data, aes(x = Year)) +
  geom_line(aes(y = EV_Sales, color = "EV Sales"), size = 2) +
  geom_line(aes(y = Gasoline_Sales, color = "Gasoline Sales"), size = 2) +
  scale_color_manual(values = c("EV Sales" = "steelblue", "Gasoline Sales" = "darkred")) +
  labs(title = "Vehicle Sales: EV vs Gasoline",
       x = "Year", y = "Vehicles Sold", color = "Vehicle Type") +
  theme_minimal(base_size = 16)

EV Market Share - Bullet Chart

sales_data <- sales_data %>%
  mutate(EV_Market_Share = round((EV_Sales / (EV_Sales + Gasoline_Sales)) * 100, 1))

ggplot(sales_data, aes(x = Year, y = EV_Market_Share)) +
  geom_col(fill = "skyblue", width = 0.6) +
  geom_text(aes(label = paste0(EV_Market_Share, "%")), vjust = -0.3, size = 5) +
  labs(title = "EV Market Share Over Time", x = "Year", y = "EV Market Share (%)") +
  theme_minimal(base_size = 16)

CO₂ Emissions by Fuel Type - Bar Chart

co2_data <- read_csv("co2_emissions.csv")
## Rows: 2 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Fuel_Type
## dbl (1): CO2_Emissions
## 
## ℹ 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.
ggplot(co2_data, aes(x = Fuel_Type, y = CO2_Emissions, fill = Fuel_Type)) +
  geom_bar(stat = "identity", width = 0.5) +
  labs(title = "CO₂ Emissions by Fuel Type", x = "Fuel Type", y = "Emissions (g/km)") +
  theme_minimal(base_size = 16) +
  theme(legend.position = "none")

Fuel Efficiency (MPG/MPGe) - Pictograph (Simplified Icons)

efficiency_data <- read_csv("fuel_efficiency.csv")
## Rows: 20 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Vehicle_Type
## dbl (1): MPG
## 
## ℹ 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.
eff_avg <- efficiency_data %>% group_by(Vehicle_Type) %>% summarise(Average_MPG = round(mean(MPG), 0))

icons <- c("🚗", "🔌")
names(icons) <- c("Gasoline", "Electric")

eff_avg$Icon <- icons[eff_avg$Vehicle_Type]
eff_avg$Repeat <- eff_avg$Average_MPG %/% 10

for (i in 1:nrow(eff_avg)) {
  cat(eff_avg$Vehicle_Type[i], " ", strrep(eff_avg$Icon[i], eff_avg$Repeat[i]), " (", eff_avg$Average_MPG[i], " MPG)", "\n")
}
## Electric   🔌🔌🔌🔌🔌🔌🔌🔌🔌🔌  ( 101  MPG) 
## Gasoline   🚗🚗  ( 25  MPG)

Fuel Efficiency Distribution - Simple Area Graph

ggplot(efficiency_data, aes(x = MPG, fill = Vehicle_Type)) +
  geom_density(alpha = 0.6) +
  labs(title = "Fuel Efficiency Distribution", x = "MPG / MPGe", y = "Density") +
  theme_minimal(base_size = 16)

Summary

  • EVs are becoming more common and their efficiency is much higher.
  • They emit less CO₂, which is better for the environment.
  • From these graphs, it’s clear EVs are the future of transportation.

References (APA 7th Edition)

  1. Our World in Data. (n.d.). Electric car sales. https://ourworldindata.org/electric-car-sales
  2. Sahin, B. R. (n.d.). Vehicle CO₂ Emissions Dataset. Kaggle. https://www.kaggle.com/datasets/brsahan/vehicle-co2-emissions-dataset
  3. U.S. Department of Energy. (n.d.). Download Fuel Economy Data. FuelEconomy.gov. https://www.fueleconomy.gov/feg/download.shtml
  4. International Energy Agency. (2023). Global EV Outlook 2023. https://www.iea.org/reports/global-ev-outlook-2023
  5. Transport & Environment. (2022). Electric vs. combustion cars: Facts. https://www.transportenvironment.org/discover/electric-vs-combustion-cars-facts/
  6. European Environment Agency. (2022). Average CO2 emissions from newly registered motor vehicles. https://www.eea.europa.eu/
  7. BloombergNEF. (2023). Electric Vehicle Outlook 2023. https://about.bnef.com/electric-vehicle-outlook/

Thank You

  • Created by: Syed Akram Syed Mahamood (s4075880)
  • Rendered using RMarkdown & reveal.js
  • Hosted online on RPubs (include URL in assignment template)