PWFSLSmoke (version 1.2.100)

epa_downloadData: Download EPA air quality data

Description

This function downloads air quality data from the EPA and saves it to a directory.

Available parameter codes include:

  1. 44201 -- Ozone

  2. 42401 -- SO2

  3. 42101 -- CO

  4. 42602 -- NO2

  5. 88101 -- PM2.5

  6. 88502 -- PM2.5

  7. 81102 -- PM10

  8. SPEC -- PM2.5

  9. WIND -- Wind

  10. TEMP -- Temperature

  11. PRESS -- Barometric Pressure

  12. RH_DP -- RH and dewpoint

  13. HAPS -- HAPs

  14. VOCS -- VOCs

  15. NONOxNOy

Usage

epa_downloadData(year = NULL, parameterCode = "88101",
  downloadDir = tempdir(),
  baseUrl = "https://aqs.epa.gov/aqsweb/airdata/")

Arguments

year

year

parameterCode

pollutant code

downloadDir

directoroy where monitoring data .zip file will be saved

baseUrl

base URL for archived daily data

Value

Filepath of the downloaded zip file.

References

EPA AirData Pre-Generated Data Files

Examples

Run this code
# NOT RUN {
zipFile <- epa_downloadData(2016, "88101", '~/Data/EPA')
tbl <- epa_parseData(zipFile, "PM2.5")
# }

Run the code above in your browser using DataCamp Workspace