| 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: | 2026-05-19 09:13:27 UTC |
| Source: | https://github.com/rOpenGov/mpg |
Extract fuel economy data from FuelEconomy.gov
Thomas J. Leeper
Maintainer: Thomas J. Leeper <[email protected]>
https://www.fueleconomy.gov/feg/ws/index.shtml
View a list of variable names and descriptions for the vehicle fuel economy data
feCodebook(browse = FALSE)feCodebook(browse = FALSE)
browse |
A logical indicating whether to open the web-based codebok. Default is |
Thomas J. Leeper
Download fuel economy bulk data files
feData(type, year = NULL, ...)feData(type, year = NULL, ...)
type |
The type of data file to retrieve. |
year |
Optionally, a two- or four-digit year after 1977. |
... |
Ignored. |
Thomas J. Leeper
Retrieve vehicle emissions data by vehicle ID
feEmissions(id = NULL, pick = FALSE, ...)feEmissions(id = NULL, pick = FALSE, ...)
id |
A vehicle ID number. |
pick |
A logical indicating whether to select the ID number via an interactive menu. |
... |
Options passed to |
Thomas J. Leeper
Retrieve makes for a vehicle year
feMakes(year, ...)feMakes(year, ...)
year |
A character string containing a four-digit vehicle year. |
... |
Ignored. |
Thomas J. Leeper
Retrieve models for a make and year
feModels(year, make, ...)feModels(year, make, ...)
year |
A character string containing a four-digit vehicle year. |
make |
A character string containing a vehicle make. |
... |
Ignored. |
Thomas J. Leeper
Retrieve vehicle options for a make-model-year
feOptions(year, make, model, ...)feOptions(year, make, model, ...)
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. |
Thomas J. Leeper
Retrieve current fuel prices by fuel type.
fePrices(...)fePrices(...)
... |
Ignored. |
Thomas J. Leeper
Execute an API query
feQuery(op, baseurl = "http://www.fueleconomy.gov/ws/rest/", ...)feQuery(op, baseurl = "http://www.fueleconomy.gov/ws/rest/", ...)
op |
A character string containing an API operation, and associated arguments. |
baseurl |
The base URL for conducting the API query. |
... |
Ignored. |
Thomas J. Leeper
Retrieve vehicle fuel economy by vehicle ID
feVehicle(id = NULL, pick = FALSE, ...)feVehicle(id = NULL, pick = FALSE, ...)
id |
A vehicle ID number. |
pick |
A logical indicating whether to select the ID number via an interactive menu. |
... |
Options passed to |
Thomas J. Leeper
Retrieve years for which fuel economy data is available
feYears(...)feYears(...)
... |
Ignored. |
Thomas J. Leeper
Retrieve all fuel economy data from My MPG by vehicle ID
mympgAll(id = NULL, pick = FALSE, ...)mympgAll(id = NULL, pick = FALSE, ...)
id |
A vehicle ID number. |
pick |
A logical indicating whether to select the ID number via an interactive menu. |
... |
Options passed to |
Thomas J. Leeper
Retrieve average fuel economy from My MPG by vehicle ID
mympgAvg(id = NULL, pick = FALSE, ...)mympgAvg(id = NULL, pick = FALSE, ...)
id |
A vehicle ID number. |
pick |
A logical indicating whether to select the ID number via an interactive menu. |
... |
Options passed to |
Thomas J. Leeper
Retrieve My MPG makes
mympgMakes(...)mympgMakes(...)
... |
Ignored. |
Thomas J. Leeper
Retrieve My MPG models for a given make
mympgModels(make, ...)mympgModels(make, ...)
make |
A character string containing a vehicle make. |
... |
Ignored. |
Thomas J. Leeper
Retrieve My MPG vehicle data by make and model
mympgVehicles(make, model, pick=FALSE, graphics=TRUE, ...)mympgVehicles(make, model, pick=FALSE, graphics=TRUE, ...)
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 |
... |
Ignored. |
Thomas J. Leeper
Use interactive menus to retrieve a vehicle identification number
pickVehicle(graphics = TRUE)pickVehicle(graphics = TRUE)
graphics |
A logical indicating whether to use graphical menus (the default) or, if |
Thomas J. Leeper