cars_mpg | R Documentation |
A dataset containing information on various aspects of fuel economy for cars from 1984 to 2020. Data have been cleaned to include more explicit NAs, where in the original data missing values were sometimes denoted by -1 or 0.
cars_mpg
A data frame with 43,221 rows and 83 variables:
annual petroleum consumption in barrels for fuelType1 (1)
annual petroleum consumption in barrels for fuelType2 (1)
time to charge an electric vehicle in hours at 120 V
time to charge an electric vehicle in hours at 240 V
city MPG for fuelType1 (2), (11)
unrounded city MPG for fuelType1 (2), (3)
city MPG for fuelType2 (2)
unrounded city MPG for fuelType2 (2), (3)
city gasoline consumption (gallons/100 miles) in charge depleting mode (4)
city electricity consumption in kw-hrs/100 miles
EPA city utility factor (share of electricity) for PHEV
tailpipe CO2 in grams/mile for fuelType1 (5)
tailpipe CO2 in grams/mile for fuelType2 (5)
tailpipe CO2 in grams/mile for fuelType2 (5)
tailpipe CO2 in grams/mile for fuelType1 (5)
combined MPG for fuelType1 (2), (11)
unrounded combined MPG for fuelType1 (2), (3)
combined MPG for fuelType2 (2)
unrounded combined MPG for fuelType2 (2), (3)
combined electricity consumption in kw-hrs/100 miles
combined gasoline consumption (gallons/100 miles) in charge depleting mode (4)
EPA combined utility factor (share of electricity) for PHEV
engine cylinders
engine displacement in liters
EPA model type index
engine descriptor; see http://www.fueleconomy.gov/feg/findacarhelp.shtml#engine
electric motor (kw-hrs)
EPA Fuel Economy Score (-1 = Not available)
annual fuel cost for fuelType1 ($) (7)
annual fuel cost for fuelType2 ($) (7)
fuel type with fuelType1 and fuelType2 (if applicable)
fuel type 1. For single fuel vehicles, this will be the only fuel. For dual fuel vehicles, this will be the conventional fuel.
fuel type 2. For dual fuel vehicles, this will be the alternative fuel (e.g. E85, Electricity, CNG, LPG). For single fuel vehicles, this field is not used
EPA GHG score (-1 = Not available)
EPA GHG score for dual fuel vehicle running on the alternative fuel (-1 = Not available)
if G or T, this vehicle is subject to the gas guzzler tax
highway MPG for fuelType1 (2), (11)
unrounded highway MPG for fuelType1 (2), (3)
highway MPG for fuelType2 (2)
unrounded highway MPG for fuelType2 (2),(3)
highway gasoline consumption (gallons/100miles) in charge depleting mode (4)
highway electricity consumption in kw-hrs/100 miles
EPA highway utility factor (share of electricity) for PHEV
hatchback luggage volume (cubic feet) (8)
hatchback passenger volume (cubic feet) (8)
vehicle record id
2 door luggage volume (cubic feet) (8)
4 door luggage volume (cubic feet) (8)
manufacturer (division)
3-character manufacturer code
model name (carline)
has My MPG data; see yourMpgVehicle and yourMpgDriverVehicle
if true, this vehicle operates on a blend of gasoline and electricity in charge depleting mode
2-door passenger volume (cubic feet) (8)
4-door passenger volume (cubic feet) (8)
EPA range for fuelType2
EPA city range for fuelType2
EPA highway range for fuelType2
transmission descriptor; see http://www.fueleconomy.gov/feg/findacarhelp.shtml#trany
transmission
unadjusted city MPG for fuelType1; see the description of the EPA test procedures
unadjusted city MPG for fuelType2; see the description of the EPA test procedures
unadjusted highway MPG for fuelType1; see the description of the EPA test procedures
unadjusted highway MPG for fuelType2; see the description of the EPA test procedures
EPA vehicle size class
model year
you save/spend over 5 years compared to an average car ($). Savings are positive; a greater amount spent yields a negative number. For dual fuel vehicles, this is the cost savings for gasoline
if S, this vehicle is supercharged
if T, this vehicle is turbocharged
electric vehicle charger description
time to charge an electric vehicle in hours at 240 V using the alternate charger
electric vehicle alternate charger description
date the vehicle record was created (ISO 8601 format)
date the vehicle record was last modified (ISO 8601 format)
vehicle has start-stop technology (Y, N, or blank for older vehicles)
EPA composite gasoline-electricity city MPGe for plug-in hybrid vehicles
EPA composite gasoline-electricity highway MPGe for plug-in hybrid vehicles
EPA composite gasoline-electricity combined city-highway MPGe for plug-in hybrid vehicles
Produced via: library(tidyverse) cars_mpg <- read_csv("https://www.fueleconomy.gov/feg/epadata/vehicles.csv") mutate(across(where(is.numeric), ~ifelse(.x == 0 | .x == -1, NA, .x))) save(cars_mpg, file = "data/cars_mpg.rda")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.