This dataset shows the Battery Electric Vehicles (BEVs) and Plug-in Hybrid Electric Vehicles (PHEVs) that are currently registered through Washington State Department of Licensing(DOL)
The data was sourced from the Washington State DOL and includes various attributes of the vehicles such as make, model, and electric range. This topic is of personal interest to me as it pertains to environmental sustainability and technological advancement in transportation.
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Visualization 1: Average Count of Electric Vehicles by Type and Model Year (Heatmap)
Rows: 159467 Columns: 17
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (11): VIN (1-10), County, City, State, Make, Model, Electric Vehicle Typ...
dbl (6): Postal Code, Model Year, Electric Range, Base MSRP, Legislative Di...
ℹ 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.
I will now create a heatmap to visualize the average count of electric vehicles by type and model year.
heatmap_plot <-ggplot(long_heatmap_data, aes(x =`Electric Vehicle Type`, y =`Model Year`, fill = Average_Count)) +geom_tile() +scale_fill_viridis_c(option ="D", begin =0.3, end =0.8) +labs(title ='Average Count of Electric Vehicles by Type and Model Year', x ='Electric Vehicle Type', y ='Model Year', fill ="Average Count",caption ='Source: the Washington State DOL') +theme_minimal()ggplotly(heatmap_plot)
Visualization 1: Average Count of Electric Vehicles by Type and Model Year (Heatmap)
The dataset I worked with focuses on Electric Vehicles (EVs) and Plug-in Hybrid Electric Vehicles (PHEVs) registered through the Washington State Department of Licensing (DOL). It includes various attributes such as vehicle make, model, electric range, and more. The data was sourced from the Washington State DOL, and I performed data cleaning to ensure its quality. This involved filtering for specific makes (TESLA and NISSAN) and summarizing the data by model year and electric vehicle type. I chose this dataset because it aligns with the growing interest in electric vehicles due to their environmental impact and the transition towards sustainable transportation. It’s crucial to understand the trends and patterns in EV adoption, which can contribute to more informed decisions regarding electric vehicle infrastructure and policies.
In my background research, I found that electric vehicles have been gaining popularity globally as a cleaner and more energy-efficient alternative to traditional gasoline-powered vehicles. Government incentives, technological advancements, and increased environmental awareness have contributed to this shift. Moreover, different types of EVs, such as BEVs (Battery Electric Vehicles) and PHEVs, cater to varying consumer needs. The adoption of electric vehicles has implications for reducing greenhouse gas emissions, improving air quality, and reducing dependence on fossil fuels. Studies have shown that electric vehicles play a crucial role in combating climate change and achieving sustainability goals.
The heatmap represents the average count of electric vehicles by type and model year. It provides a visual overview of the adoption trends over the years. One notable pattern is the significant increase in the number of BEVs (Battery Electric Vehicles) from 2015 onwards, indicating a shift towards all-electric vehicles. PHEVs also show growth but at a slower pace.
Visualization 2: Distribution of Electric Range Among Different Vehicle Makes (Boxplot)
Now I’ll convert necessary columns to the appropriate data types
Here I will perform my statistical analysis. For example, a simple linear regression to predict “Electric Range” based on “Model year” and “Base MSRP”.
model <-lm(`Electric Range`~`Model Year`+`Base MSRP`, data = recent_evs)summary(model)
Call:
lm(formula = `Electric Range` ~ `Model Year` + `Base MSRP`, data = recent_evs)
Residuals:
Min 1Q Median 3Q Max
-192.04 -33.97 -10.53 21.47 1191.70
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.743e+04 1.751e+02 270.8 <2e-16 ***
`Model Year` -2.344e+01 8.667e-02 -270.4 <2e-16 ***
`Base MSRP` -1.630e-03 3.672e-05 -44.4 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 78.99 on 148379 degrees of freedom
Multiple R-squared: 0.3306, Adjusted R-squared: 0.3306
F-statistic: 3.665e+04 on 2 and 148379 DF, p-value: < 2.2e-16
Data Visualization
Here is another type of visualization, a boxplot, which can show the spread of the electric range for different makes.
ggplot(recent_evs, aes(x = Make, y =`Electric Range`, fill = Make)) +geom_boxplot() +scale_fill_viridis_d() +theme_minimal() +labs(title ="Distribution of Electric Range Among Different Vehicle Makes",x ="Make",y ="Electric Range (miles)",fill ="Make") +theme(axis.text.x =element_text(angle =45, hjust =1))
Visualization 2: Distribution of Electric Range Among Different Vehicle Makes (Boxplot)
This visualization focuses on the distribution of electric range among different vehicle makes, using a boxplot. The dataset used here is a subset of the previous dataset, specifically filtered for recent electric vehicles (2015 onwards) and makes with sufficient data. Electric range is a critical factor for EV consumers, as it directly impacts the vehicle’s usability.
Electric vehicle range is a crucial consideration for potential buyers, as it determines how far the vehicle can travel on a single charge. In my background research, I found that electric vehicle ranges have been steadily improving over the years, thanks to advancements in battery technology. Major automakers are competing to offer longer-range electric vehicles to meet consumer demands and eliminate “range anxiety.”
I also discovered that electric vehicle ranges vary significantly between different makes and models. Some manufacturers prioritize longer ranges, while others focus on affordability or other features. This variation in range can influence consumers’ purchasing decisions.
The boxplot visually represents the spread of electric range for various vehicle makes. Each boxplot provides information about the minimum, maximum, median, and quartiles of electric range for a specific make. It allows for easy comparisons between makes and identifies any outliers. The use of the viridis color palette enhances the plot, distinguishing between different makes. The boxplots reveal interesting patterns, such as certain makes consistently offering longer electric ranges compared to others. These patterns can inform consumers about the range options available within different makes.
Overall, this visualization provides valuable insights into the distribution of electric range among different vehicle makes, helping consumers make informed choices when selecting an electric vehicle.
In conclusion, these visualizations shed light on the trends in electric vehicle adoption and the variation in electric range among different vehicle makes. While the data collection methodology remains unspecified, the insights gained from these visualizations contribute to a better understanding of the electric vehicle landscape and its significance in addressing environmental concerns.