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)
)
Run the code above in your browser using DataLab