``` r
ev <- read_csv("Electric_Vehicle_Population_Data.csv")
## Rows: 235692 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.
ev_clean <- ev %>%
  filter(!is.na(`Electric Range`),
         !is.na(`Model Year`),
         !is.na(Make),
         !is.na(`Electric Vehicle Type`)) %>%
  filter(Make %in% c("TESLA", "NISSAN", "CHEVROLET", "TOYOTA", "BMW", "BENTLEY", "KIA", "VOLVO"))
ev_clean %>%
  filter(Make %in% c("TESLA", "NISSAN", "CHEVROLET", "TOYOTA", "BMW", "BENTLEY", "KIA", "VOLVO")) %>%
  ggplot(aes(x = `Model Year`, y = `Electric Range`, color = Make)) +
  geom_point(alpha = 0.7) +
  labs(title = "Electric Range by Model Year",
       x = "Model Year", y = "Electric Range (miles)", color = "Make") +
  theme_minimal()

Boxplot by Make

ev_clean %>%
  filter(Make %in% c("TESLA", "NISSAN", "CHEVROLET", "TOYOTA", "BMW", "BENTLEY", "KIA", "VOLVO")) %>%
  ggplot(aes(x = Make, y = `Electric Range`, fill = Make)) +
  geom_boxplot() +
  labs(title = "Electric Range by Make", x = "Make", y = "Range (miles)") +
  theme_minimal()

Vehicle Type Count

ggplot(ev_clean, aes(x = `Electric Vehicle Type`, fill = `Electric Vehicle Type`)) +
  geom_bar() +
  labs(title = "Distribution of Vehicle Types", x = "Vehicle Type", y = "Count") +
  theme_minimal()

Histogram by Vehicle Type

ggplot(ev_clean, aes(x = `Electric Range`, fill = `Electric Vehicle Type`)) +
  geom_histogram(binwidth = 25, alpha = 0.6, position = "identity") +
  labs(title = "Electric Range Distribution by Vehicle Type", x = "Electric Range (miles)", y = "Count") +
  theme_minimal()

Faceted Chart

ev_clean %>%
  filter(Make %in% c("TESLA", "NISSAN", "CHEVROLET", "TOYOTA", "BMW", "BENTLEY", "KIA", "VOLVO")) %>%
  ggplot(aes(x = `Model Year`, y = `Electric Range`, color = Make)) +
  geom_point(alpha = 0.7) +
  facet_wrap(~ `Electric Vehicle Type`) +
  labs(title = "Electric Range by Year, Faceted by Vehicle Type",
       x = "Model Year", y = "Electric Range (miles)") +
  theme_minimal()

  1. Electric Range by Model Year This graph shows how the electric range of cars has changed over the years for different brands like Tesla, Nissan, and BMW. You can clearly see that newer cars tend to have higher electric ranges, especially for Tesla.

  2. Electric Range by Make This boxplot compares the electric range between different brands. Tesla and Chevrolet generally offer higher ranges, while Bentley and Volvo tend to have shorter ranges on average.

  3. Distribution of Vehicle Types This bar chart tells us that Battery Electric Vehicles (BEVs) are way more common than Plug-in Hybrid Electric Vehicles (PHEVs) in the dataset.

  4. Electric Range by Year, Faceted by Vehicle Type This chart splits the data into two groups: BEVs and PHEVs. It shows how electric range has changed over time for each type. You can tell BEVs are more consistent and have made bigger improvements in range.

  5. Electric Range Distribution by Vehicle Type This histogram shows how common different electric ranges are. Most vehicles have a lower range, but BEVs have a wider spread, meaning they can go much farther than PHEVs in general.

  6. Electric Range Distribution By Make This chart shows how electric range varies by car brand. Most Tesla vehicles have really low or missing electric range values in the dataset, which explains the tall bar at zero. You can also see that Tesla and Chevrolet have a lot of models with longer ranges, while other brands like Volvo or Bentley tend to stick to the lower end. It’s interesting to compare how spread out the range is across different companies.