vehicles: Vehicle data

Description Usage Format Source Examples

Description

Fuel economy data from the EPA, 1985-2015. This dataset contains selected varaibles, and removes vehicles with incomplete data (e.g. no drive train data)

Usage

1

Format

A data frame with variables:

id

Unique EPA identifier

make

Manufacturer

model

Model name

year

Model year

class

EPA vehicle size class, http://www.fueleconomy.gov/feg/ws/wsData.shtml#VClass

trans

Transmission

drive

Drive train

cyl

Number of cylinders

displ

Engine displacement, in litres

fuel

Fuel type

hwy

Highway fuel economy, in mpg

cty

City fuel economy, in mpg

Source

http://www.fueleconomy.gov/feg/download.shtml

Examples

1
2
3
4
if (require("dplyr")) {
vehicles
vehicles %>% group_by(year) %>% summarise(cty = mean(cty))
}

Example output

Loading required package: dplyr

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

# A tibble: 32 x 2
    year   cty
   <int> <dbl>
 1  1984  15.6
 2  1985  17.9
 3  1986  17.7
 4  1987  17.3
 5  1988  17.3
 6  1989  17.1
 7  1990  17.0
 8  1991  16.8
 9  1992  16.8
10  1993  17.0
# ... with 22 more rows

fueleconomy documentation built on May 30, 2017, 3:32 a.m.