epa_aqs_getSites: Download and parse EPA AQS sites metadata

View source: R/epa_aqs_getSites.R

epa_aqs_getSitesR Documentation

Download and parse EPA AQS sites metadata

Description

Download site metadata from the US EPA and save it to a directory. Then uncompress and parse the data into a tibble.

Usage

epa_aqs_getSites(
  url = "https://aqs.epa.gov/aqsweb/airdata/aqs_sites.zip",
  downloadDir = tempdir(),
  quiet = TRUE
)

Arguments

url

URL for the aqs_sites.zip file.

downloadDir

Directory where .zip file will be saved.

quiet

Logical passed on to utils::download.file().

Value

Tibble of EPA site metadata.

References

Site and Monitor Descriptions

Examples

## Not run: 
library(MazamaCoreUtils)
library(AirMonitorIngest)

# Create a directory specifically for EPA data
dir.create("~/Data/EPA", recursive = TRUE)

# Set logging level so messages and errors will appear in the console
MazamaCoreUtils::initializeLogging(logDir = "~/Data/EPA/")
logger.setLevel(TRACE)

# Download and parse site metadata
AQS_sites <- epa_aqs_getSites(downloadDir = "~/Data/EPA", quiet = FALSE)

## End(Not run)

pnwairfire/AirMonitorIngest documentation built on Feb. 18, 2025, 7:50 p.m.