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. I chose this dataset due to a personal and scholarly interest in sustainable transportation, a field where EVs are revolutionizing our approach to mobility. This area is not only technologically progressive but also critical in mitigating environmental impacts such as carbon emissions and fossil fuel dependency.
The momentum behind the EV revolution is palpable. According to the International Energy Agency (IEA), global electric car sales have been experiencing an unprecedented surge, doubling in just one year to a new record in 2021 (IEA, 2021). The driving forces behind this surge are multifaceted: governments are offering incentives to offset the higher upfront costs of EVs, advancements in battery technology are extending ranges and reducing prices, and consumers are increasingly aware of the environmental implications of their choices.
── 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
library(readr)library(dplyr)library(plotly)
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
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.
Visualization 1: Average Count of Electric Vehicles by Make and Model Year
Create the bar graph in Plotly
bar_data <- filtered_data %>%group_by(`Model Year`, Make) %>%summarise(Count =n(), .groups ='drop')interactive_bar_graph <-plot_ly(bar_data, x =~`Model Year`, y =~Count, color =~Make, colors =viridis_pal(option ="D")(length(unique(bar_data$Make))), type ='bar') %>%layout(barmode ='group',title ='Average Count of Electric Vehicles by Make and Model Year',xaxis =list(title ='Model Year'),yaxis =list(title ='Average Count'),annotations =list(list(text ='Data Source: Washington State Department of Licensing (DOL)',xref ='paper',yref ='paper',x =0.5,y =-0.15,showarrow =FALSE ) ) )interactive_bar_graph
Summary Visualization 1
The visualization at hand is a bar graph entitled “Average Count of Electric Vehicles by Make and Model Year,” crafted using Plotly for an interactive experience. This graph depicts the number of EVs and PHEVs registered each year, disaggregated by the manufacturer. A captivating pattern emerges from the visualization: a significant uptick in the number of EVs from certain manufacturers, signaling a market inclination towards these vehicles. Interestingly, while some brands show a steady rise, others exhibit sporadic growth, indicating varied market strategies or consumer preferences. One intriguing aspect of the data was the observable spike in registrations around specific years, which could correlate with the introduction of new models or increased incentives. A limitation encountered was the inability to drill down into regional variations within the state, which could have provided more granular insights into adoption patterns. In conclusion, the visualization underscores the burgeoning narrative of EVs in modern transport, a testament to technological innovation and environmental stewardship. Despite the inability to dissect the data collection methodology, the dataset remains a valuable asset in understanding the trajectory of electric vehicle adoption.
library(tidyverse)library(ggplot2)library(plotly)# Prepare the data by selecting the 'Electric Range' for the histogramprepared_data <- electric_vehicle_data %>%select(`Electric Range`) %>%filter(!is.na(`Electric Range`))# Create the histogramhistogram <-ggplot(prepared_data, aes(x =`Electric Range`)) +geom_histogram(bins =30, fill ="skyblue", color ="black") +# Define number of bins and colorsscale_x_continuous(breaks =seq(0, max(prepared_data$`Electric Range`), by =50)) +# X-axis breakslabs(title ='Distribution of Electric Range in Electric Vehicles',x ='Electric Range (miles)',y ='Count of Vehicles',caption ='Data Source: Washington State Department of Licensing (DOL)' ) +theme_minimal() # Use a minimal theme# Convert to interactive plotinteractive_histogram <-ggplotly(histogram)# Print the plot to the consoleprint(interactive_histogram)# Output the plotinteractive_histogram
Visualization 2: Distribution of Electric Range Among Different Vehicle Makes (Boxplot)
Here is another type of visualization, a boxplot, which can show the spread of the electric range for different makes.
interactive_boxplot_graph <-plot_ly(filtered_data, y =~`Electric Range`, color =~Make, colors =viridis_pal(option ="D")(length(unique(filtered_data$Make))), type ='box') %>%layout(title ="Distribution of Electric Range Among Different Vehicle Makes",xaxis =list(title ='Make'),yaxis =list(title ='Electric Range (miles)'),annotations =list(list(text ='Data Source: Washington State Department of Licensing (DOL)',xref ='paper',yref ='paper',x =0.5,y =-0.19,showarrow =FALSE ) ) )interactive_boxplot_graph
Summary Visualization 2
This visualization focuses on the distribution of electric range among different vehicle makes, using a boxplot. Electric range is a critical factor for EV consumers, as it directly impacts the vehicle’s usability. The boxplot visualization provides valuable insights into the distribution of electric range among different vehicle makes. It allows us to compare the electric range spread across various makes. 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.