Skip to contents

Details from the EPA.

Usage

epa2012

Format

A data frame with 1129 observations on the following 28 variables.

model_yr

a numeric vector

mfr_name

Manufacturer name.

division

Vehicle division.

carline

Vehicle line.

mfr_code

Manufacturer code.

model_type_index

Model type index.

engine_displacement

Engine displacement.

no_cylinders

Number of cylinders.

transmission_speed

Transmission speed.

city_mpg

City mileage.

hwy_mpg

Highway mileage.

comb_mpg

Combined mileage.

guzzler

Whether the car is considered a "guzzler" or not, a factor with levels N and Y.

air_aspir_method

Air aspiration method.

air_aspir_method_desc

Air aspiration method description.

transmission

Transmission type.

transmission_desc

Transmission type description.

no_gears

Number of gears.

trans_lockup

Whether transmission locks up, a factor with levels N and Y.

trans_creeper_gear

A factor with level N only.

drive_sys

Drive system, a factor with levels.

drive_desc

Drive system description.

fuel_usage

Fuel usage, a factor with levels.

fuel_usage_desc

Fuel usage description.

class

Class of car.

car_truck

Car or truck, a factor with levels car, 1, 2.

release_date

Date of vehicle release.

fuel_cell

Whether the car has a fuel cell or not, a factor with levels N, Y.

Source

Fueleconomy.gov, Shared MPG Estimates: Toyota Prius 2012.

See also

epa2021

Examples


library(ggplot2)
library(dplyr)

# Variable descriptions
distinct(epa2012, air_aspir_method_desc, air_aspir_method)
#> # A tibble: 4 × 2
#>   air_aspir_method air_aspir_method_desc
#>   <fct>            <fct>                
#> 1 NA               Naturally Aspirated  
#> 2 TC               Turbocharged         
#> 3 SC               Supercharged         
#> 4 NA               NA                   
distinct(epa2012, transmission_desc, transmission)
#> # A tibble: 7 × 2
#>   transmission transmission_desc                                       
#>   <fct>        <fct>                                                   
#> 1 M            Manual                                                  
#> 2 AM           Automated Manual                                        
#> 3 SA           Semi-Automatic                                          
#> 4 A            Automatic                                               
#> 5 SCV          Selectable Continuously Variable (e.g. CVT with paddles)
#> 6 CVT          Continuously Variable                                   
#> 7 OT           Other                                                   
distinct(epa2012, drive_desc, drive_sys)
#> # A tibble: 5 × 2
#>   drive_sys drive_desc             
#>   <fct>     <fct>                  
#> 1 R         2-Wheel Drive, Rear    
#> 2 A         All Wheel Drive        
#> 3 F         2-Wheel Drive, Front   
#> 4 4         4-Wheel Drive          
#> 5 P         Part-time 4-Wheel Drive
distinct(epa2012, fuel_usage_desc, fuel_usage)
#> # A tibble: 7 × 2
#>   fuel_usage fuel_usage_desc                          
#>   <fct>      <fct>                                    
#> 1 GP         Gasoline (Premium Unleaded Recommended)  
#> 2 GPR        Gasoline (Premium Unleaded Required)     
#> 3 G          Gasoline (Regular Unleaded Recommended)  
#> 4 EL         Electricity                              
#> 5 DU         Diesel                                   
#> 6 GM         Gasoline (Mid Grade Unleaded Recommended)
#> 7 H          Hydrogen                                 

# Guzzlers and their mileages
ggplot(epa2012, aes(x = city_mpg, y = hwy_mpg, color = guzzler)) +
  geom_point() +
  facet_wrap(~guzzler, ncol = 1)