Package 'mpg'

Title: FuelEconomy.gov Data
Description: Extract fuel economy data from FuelEconomy.gov.
Authors: Authors@R: c(person("Thomas J.", "Leeper", role = c("aut", "cre"), email = "[email protected]"))
Maintainer: Thomas J. Leeper <[email protected]>
License: GPL-2
Version: 0.1
Built: 2025-01-30 11:22:59 UTC
Source: https://github.com/rOpenGov/mpg

Help Index


FuelEconomy.gov Data

Description

Extract fuel economy data from FuelEconomy.gov

Author(s)

Thomas J. Leeper

Maintainer: Thomas J. Leeper <[email protected]>

References

https://www.fueleconomy.gov/feg/ws/index.shtml


Fuel economy codebook

Description

View a list of variable names and descriptions for the vehicle fuel economy data

Usage

feCodebook(browse = FALSE)

Arguments

browse

A logical indicating whether to open the web-based codebok. Default is FALSE.

Author(s)

Thomas J. Leeper


Bulk data

Description

Download fuel economy bulk data files

Usage

feData(type, year = NULL, ...)

Arguments

type

The type of data file to retrieve.

year

Optionally, a two- or four-digit year after 1977.

...

Ignored.

Author(s)

Thomas J. Leeper


Vehicle emissions data

Description

Retrieve vehicle emissions data by vehicle ID

Usage

feEmissions(id = NULL, pick = FALSE, ...)

Arguments

id

A vehicle ID number.

pick

A logical indicating whether to select the ID number via an interactive menu.

...

Options passed to pickVehicle, if pick=TRUE.

Author(s)

Thomas J. Leeper


Vehicle makes

Description

Retrieve makes for a vehicle year

Usage

feMakes(year, ...)

Arguments

year

A character string containing a four-digit vehicle year.

...

Ignored.

Author(s)

Thomas J. Leeper


Vehicle models

Description

Retrieve models for a make and year

Usage

feModels(year, make, ...)

Arguments

year

A character string containing a four-digit vehicle year.

make

A character string containing a vehicle make.

...

Ignored.

Author(s)

Thomas J. Leeper


Vehicle options

Description

Retrieve vehicle options for a make-model-year

Usage

feOptions(year, make, model, ...)

Arguments

year

A character string containing a four-digit vehicle year.

make

A character string containing a vehicle make.

model

A character string containing a vehicle model.

...

Ignored.

Author(s)

Thomas J. Leeper


Fuel prices

Description

Retrieve current fuel prices by fuel type.

Usage

fePrices(...)

Arguments

...

Ignored.

Author(s)

Thomas J. Leeper


API Query

Description

Execute an API query

Usage

feQuery(op, baseurl = "http://www.fueleconomy.gov/ws/rest/", ...)

Arguments

op

A character string containing an API operation, and associated arguments.

baseurl

The base URL for conducting the API query.

...

Ignored.

Author(s)

Thomas J. Leeper


Vehicle fuel economy

Description

Retrieve vehicle fuel economy by vehicle ID

Usage

feVehicle(id = NULL, pick = FALSE, ...)

Arguments

id

A vehicle ID number.

pick

A logical indicating whether to select the ID number via an interactive menu.

...

Options passed to pickVehicle, if pick=TRUE.

Author(s)

Thomas J. Leeper


Fuel economy years

Description

Retrieve years for which fuel economy data is available

Usage

feYears(...)

Arguments

...

Ignored.

Author(s)

Thomas J. Leeper


My MPG data

Description

Retrieve all fuel economy data from My MPG by vehicle ID

Usage

mympgAll(id = NULL, pick = FALSE, ...)

Arguments

id

A vehicle ID number.

pick

A logical indicating whether to select the ID number via an interactive menu.

...

Options passed to pickVehicle, if pick=TRUE.

Author(s)

Thomas J. Leeper


My MPG averages

Description

Retrieve average fuel economy from My MPG by vehicle ID

Usage

mympgAvg(id = NULL, pick = FALSE, ...)

Arguments

id

A vehicle ID number.

pick

A logical indicating whether to select the ID number via an interactive menu.

...

Options passed to pickVehicle, if pick=TRUE.

Author(s)

Thomas J. Leeper


My MPG makes

Description

Retrieve My MPG makes

Usage

mympgMakes(...)

Arguments

...

Ignored.

Author(s)

Thomas J. Leeper


My MPG models

Description

Retrieve My MPG models for a given make

Usage

mympgModels(make, ...)

Arguments

make

A character string containing a vehicle make.

...

Ignored.

Author(s)

Thomas J. Leeper


My MPG vehicles

Description

Retrieve My MPG vehicle data by make and model

Usage

mympgVehicles(make, model, pick=FALSE, graphics=TRUE, ...)

Arguments

make

A character string containing a vehicle make.

model

A character string containing a vehicle model.

pick

A logical indicating whether to select the ID number via an interactive menu.

graphics

If pick=TRUE, a logical indicating whether to use graphical menus (the default) or, if FALSE, text-based menus.

...

Ignored.

Author(s)

Thomas J. Leeper


Interactive vehicle menus

Description

Use interactive menus to retrieve a vehicle identification number

Usage

pickVehicle(graphics = TRUE)

Arguments

graphics

A logical indicating whether to use graphical menus (the default) or, if FALSE, text-based menus.

Author(s)

Thomas J. Leeper