Details from the EPA.
A data frame with 1108 observations on the following 28 variables.
a numeric vector
Model type index.
Number of cylinders.
Whether the car is considered a "guzzler" or not, a factor with levels
Air aspiration method.
Air aspiration method description.
Transmission type description.
Number of gears.
Whether transmission locks up, a factor with levels
A factor with level
Drive system, a factor with levels.
Drive system description.
Fuel usage, a factor with levels.
Fuel usage description.
Class of car.
Car or truck, a factor with levels
Date of vehicle release.
Whether the car has a fuel cell or not, a factor with levels
Fuel Economy Data from fueleconomy.gov. Retrieved 6 May, 2021.
library(ggplot2) library(dplyr) # Variable descriptions distinct(epa2021, air_aspir_method_desc, air_aspir_method) distinct(epa2021, transmission_desc, transmission) distinct(epa2021, drive_desc, drive_sys) distinct(epa2021, fuel_usage_desc, fuel_usage) # Guzzlers and their mileages ggplot(epa2021, aes(x = city_mpg, y = hwy_mpg, color = guzzler)) + geom_point() + facet_wrap(~guzzler, ncol = 1) # Compare to 2012 epa2021 %>% bind_rows(epa2012) %>% group_by(model_yr) %>% summarise( mean_city = mean(city_mpg), mean_hwy = mean(hwy_mpg) )