downloadWQP: Download water quality, station, and other data from USEPA...

View source: R/downloadWQP.r

downloadWQPR Documentation

Download water quality, station, and other data from USEPA Water Quality Portal

Description

Download data from EPA's Water Quality Portal (WQP) as .csv files to outfile_path folder.

Usage

downloadWQP(
  outfile_path = getwd(),
  retrieve = c("narrowresult", "activity", "sites", "detquantlim"),
  siteType = c("Aggregate surface-water-use", "Lake, Reservoir, Impoundment", "Spring",
    "Stream"),
  statecode = "US:49",
  zip = FALSE,
  unzip = FALSE,
  ...
)

Arguments

outfile_path

Path for file outputs. Defaults to current working directory.

retrieve

Vector of data type names to retrieve from WQP. One or more of: "result","narrowresult","activity","sites","detquantlim". Defaults to query narrowresult, activity, sites, and detquantlim.

zip

Logical. If FALSE (default) files downloaded as zip folders are not automatically unzipped. If TRUE, the function will unzip all downloaded zip files. Only used if zip==TRUE.

...

Other arguments to be passed to readWQP when generating a query URL.

start_date

Query start date. "mm/dd/yyyy" format.

end_date

Query end date. "mm/dd/yyyy" format.

Value

Exports .csv files for all selected data types during selected date period in specified output path.

Examples

# Read 2018 download narrow result & sites
downloadWQP(outfile_path='C:\\Your\\Folder\\Path', start_date="01/01/2018", end_date="12/31/2018", retrieve=c("narrowresult","sites"))

utah-dwq/wqTools documentation built on July 18, 2024, 6:45 a.m.