Link to Dataset

This comprehensive dataset provides detailed information on Battery Electric Vehicles (BEVs) and Plug-in Hybrid Electric Vehicles (PHEVs) currently registered through the Washington State Department of Licensing (DOL). It offers a thorough examination of electric vehicle ownership patterns and trends, including vehicle registration, make, model, electric vehicle type, clean alternative fuel vehicle (CAFV) eligibility, electric range, base MSRP, legislative district, DOL vehicle ID, vehicle location, electric utility, and 2020 Census tract. 

EV

Objectives:

1. CAFV Eligibility and Trends:

2. Electric Range Distribution:

3. Base MSRP Analysis:

4. Geographical Insights:

5. Utility Provider Preferences:

# installing the required packages
install.packages(c("tidyverse","plotly","ggthemes", "bslib"), repos = "https:\\cran.rstudio.com")
library(tidyverse)
library(plotly)
library(ggthemes)
library(bslib)
library(knitr)

# Loading the data
ev <- read.csv("F:\\R practice\\R Projects\\Project 5\\EV Project\\Electric_Vehicle_Population_Data.csv")

# checking head and str
str(ev)
## 'data.frame':    159467 obs. of  17 variables:
##  $ VIN..1.10.                                       : chr  "2C4RC1N71H" "2C4RC1N7XL" "KNDC3DLCXN" "5YJ3E1EA0J" ...
##  $ County                                           : chr  "Kitsap" "Stevens" "Yakima" "Kitsap" ...
##  $ City                                             : chr  "Bremerton" "Colville" "Yakima" "Bainbridge Island" ...
##  $ State                                            : chr  "WA" "WA" "WA" "WA" ...
##  $ Postal.Code                                      : int  98311 99114 98908 98110 98501 98367 98902 98901 98359 98370 ...
##  $ Model.Year                                       : int  2017 2020 2022 2018 2018 2019 2019 2022 2012 2021 ...
##  $ Make                                             : chr  "CHRYSLER" "CHRYSLER" "KIA" "TESLA" ...
##  $ Model                                            : chr  "PACIFICA" "PACIFICA" "EV6" "MODEL 3" ...
##  $ Electric.Vehicle.Type                            : chr  "Plug-in Hybrid Electric Vehicle (PHEV)" "Plug-in Hybrid Electric Vehicle (PHEV)" "Battery Electric Vehicle (BEV)" "Battery Electric Vehicle (BEV)" ...
##  $ Clean.Alternative.Fuel.Vehicle..CAFV..Eligibility: chr  "Clean Alternative Fuel Vehicle Eligible" "Clean Alternative Fuel Vehicle Eligible" "Eligibility unknown as battery range has not been researched" "Clean Alternative Fuel Vehicle Eligible" ...
##  $ Electric.Range                                   : int  33 32 0 215 151 239 12 0 6 0 ...
##  $ Base.MSRP                                        : int  0 0 0 0 0 0 36900 0 0 0 ...
##  $ Legislative.District                             : int  23 7 14 23 35 26 14 15 26 23 ...
##  $ DOL.Vehicle.ID                                   : int  349437882 154690532 219969144 476786887 201185253 478017067 146830148 207786505 284893416 211699309 ...
##  $ Vehicle.Location                                 : chr  "POINT (-122.6466274 47.6341188)" "POINT (-117.90431 48.547075)" "POINT (-120.6027202 46.5965625)" "POINT (-122.5235781 47.6293323)" ...
##  $ Electric.Utility                                 : chr  "PUGET SOUND ENERGY INC" "AVISTA CORP" "PACIFICORP" "PUGET SOUND ENERGY INC" ...
##  $ X2020.Census.Tract                               : num  5.30e+10 5.31e+10 5.31e+10 5.30e+10 5.31e+10 ...
head(ev)
##   VIN..1.10.   County              City State Postal.Code Model.Year     Make
## 1 2C4RC1N71H   Kitsap         Bremerton    WA       98311       2017 CHRYSLER
## 2 2C4RC1N7XL  Stevens          Colville    WA       99114       2020 CHRYSLER
## 3 KNDC3DLCXN   Yakima            Yakima    WA       98908       2022      KIA
## 4 5YJ3E1EA0J   Kitsap Bainbridge Island    WA       98110       2018    TESLA
## 5 1N4AZ1CP7J Thurston          Tumwater    WA       98501       2018   NISSAN
## 6 KNDCC3LG6K   Kitsap      Port Orchard    WA       98367       2019      KIA
##      Model                  Electric.Vehicle.Type
## 1 PACIFICA Plug-in Hybrid Electric Vehicle (PHEV)
## 2 PACIFICA Plug-in Hybrid Electric Vehicle (PHEV)
## 3      EV6         Battery Electric Vehicle (BEV)
## 4  MODEL 3         Battery Electric Vehicle (BEV)
## 5     LEAF         Battery Electric Vehicle (BEV)
## 6     NIRO         Battery Electric Vehicle (BEV)
##              Clean.Alternative.Fuel.Vehicle..CAFV..Eligibility Electric.Range
## 1                      Clean Alternative Fuel Vehicle Eligible             33
## 2                      Clean Alternative Fuel Vehicle Eligible             32
## 3 Eligibility unknown as battery range has not been researched              0
## 4                      Clean Alternative Fuel Vehicle Eligible            215
## 5                      Clean Alternative Fuel Vehicle Eligible            151
## 6                      Clean Alternative Fuel Vehicle Eligible            239
##   Base.MSRP Legislative.District DOL.Vehicle.ID                Vehicle.Location
## 1         0                   23      349437882 POINT (-122.6466274 47.6341188)
## 2         0                    7      154690532    POINT (-117.90431 48.547075)
## 3         0                   14      219969144 POINT (-120.6027202 46.5965625)
## 4         0                   23      476786887 POINT (-122.5235781 47.6293323)
## 5         0                   35      201185253    POINT (-122.89692 47.043535)
## 6         0                   26      478017067   POINT (-122.6847073 47.50524)
##         Electric.Utility X2020.Census.Tract
## 1 PUGET SOUND ENERGY INC        53035091800
## 2            AVISTA CORP        53065950500
## 3             PACIFICORP        53077000904
## 4 PUGET SOUND ENERGY INC        53035091001
## 5 PUGET SOUND ENERGY INC        53067011720
## 6 PUGET SOUND ENERGY INC        53035092902
# Checking for null values
any(is.na(ev))
## [1] TRUE
# Count of NA's with column names
null <- colSums(is.na(ev))

null[null > 0]
##          Postal.Code Legislative.District   X2020.Census.Tract 
##                    4                  361                    4
# imputing NA's with 0
ev$Postal.Code[is.na(ev$Postal.Code)] <- 0
ev$Legislative.District[is.na(ev$Legislative.District)] <- 0
ev$X2020.Census.Tract[is.na(ev$X2020.Census.Tract)] <- 0

Analysis:

  1. CAFV Eligibility and Trends:
    • What percentage of the registered vehicles are considered Clean Alternative Fuel Vehicle (CAFV) eligible?
    • Are there any noticeable trends or changes in CAFV eligibility among different vehicle types or over various model years?
# For better readability the values of 'Electric.Vehicle.Type' column is changed to 
# 'BEV' for Battery Electric Vehicle 
# & PHEV for Plug-in Hybrid Electric Vehicles 
ev_clean <- ev %>% 
  mutate(Electric.Vehicle.Type = ifelse(Electric.Vehicle.Type == "Battery Electric Vehicle (BEV)", "BEV", "PHEV"))

# Changing column name Clean.Alternative.Fuel.Vehicle..CAFV..Eligibility to CAFV_Eligibility
ev_clean <- ev_clean %>% 
  mutate(CAFV_Eligibility = Clean.Alternative.Fuel.Vehicle..CAFV..Eligibility)

ev_clean <- ev_clean %>% 
  select(- Clean.Alternative.Fuel.Vehicle..CAFV..Eligibility)

# Clean Alternative Fuel Vehicle percentage
CAFV_perc <- ev_clean %>% 
  group_by(CAFV_Eligibility) %>% 
  summarise(count = n()) %>% 
  mutate(Perc = (count / sum(count))* 100)

Conclusion

The analysis encompassed various aspects of the electric vehicle dataset, providing several key insights:

Considering these findings collectively, the dataset reveals a dominance of BEVs in both production and electric range expansion, while PHEVs maintain a more stable presence. Tesla stands out as a popular make among registered vehicles. The moderate correlation between Base MSRP and Electric Range highlights a notable relationship between pricing and vehicle range. Moreover, geographical distribution is concentrated in King County, emphasizing localized registration patterns. These findings collectively illustrate the dynamic landscape of electric vehicles, portraying shifting trends in production, pricing, and range among different vehicle types over the observed period.