readAWQMS: Read AWQMS Water Quality Data

View source: R/readAWQMS.r

readAWQMSR Documentation

Read AWQMS Water Quality Data

Description

This function extracts water quality data from AWQMS based on user argument inputs. All arguments except type are optional, but at least one must be provided to limit download size and prevent errors connecting to AWQMS. Note that some, but not all, special characters have been accounted for (e.g. spaces, fore-slashes, and commas in characteristic names and site types).

Usage

readAWQMS(type = "results", unnest_results = TRUE, ...)

Arguments

type

Data type to read. One of "projects", "sites", "metrics", "results", "continuous_results", "indexes", or "beach_actions".

unnest_results

If TRUE (default) and type=="results", the result data frame is unnested from the query return object.

...

additional arguments to be passed to AWQMS query path. See http://awqms.org/node/2 –> AWQMS Tutorials - Web Services for optional arguments.

start_date

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

end_date

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

Value

A data frame of AWQMS data

Examples

# Read a couple of sites
sites=readAWQMS(type='sites', MonitoringLocationIdentifiersCsv=c("4900440","4900460"))
# Make a map of those sites & assign assessment units & uses
buildMap(sites=sites)
sites_aus=assignAUs(sites)
sites_aus_uses=assignUses(sites_aus)
sites_aus_uses

# Read all results from those sites (2016-2018)
results=readAWQMS(type='results', MonitoringLocationIdentifiersCsv=c("4900440","4900460"), start_date="01/01/2016", end_date="12/31/2018")

# Read a subset of those results (just two parameters, 2016-2018)
results2=readAWQMS(type='results', MonitoringLocationIdentifiersCsv=c("4900440","4900460"), Characteristic=c("Total dissolved solids","Phosphate-phosphorus"), start_date="01/01/2016", end_date="12/31/2018")

# Read Utah DWQ projects
projects=readAWQMS(type="projects",OrganizationIdentifiersCsv="UTAHDWQ_WQX")
# Read state-wide TDS
ut_tds=readAWQMS(type='results', start_date="01/01/2016", end_date="12/31/2018", StateCode="UT", Characteristic=c("Total dissolved solids"))

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