Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

importWQP

Basic Water Quality Portal Data parser


Description

Imports data from the Water Quality Portal based on a specified url.

Usage

importWQP(obs_url, zip = TRUE, tz = "UTC", csv = FALSE)

Arguments

obs_url

character URL to Water Quality Portal#' @keywords data import USGS web service

zip

logical to request data via downloading zip file. Default set to TRUE.

tz

character to set timezone attribute of datetime. Default is UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). Possible values include "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles", "America/Anchorage","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"

csv

logical. Is the data coming back with a csv or tsv format. Default is FALSE. Currently, the summary service does not support tsv, for other services tsv is the safer choice.

Value

retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for start and end times, and converted to UTC. See https://www.waterqualitydata.us/portal_userguide/ for more information.

See Also

Examples

# These examples require an internet connection to run

## Examples take longer than 5 seconds:

rawSampleURL <- constructWQPURL('USGS-01594440','01075', '', '')

rawSample <- importWQP(rawSampleURL)

rawSampleURL_NoZip <- constructWQPURL('USGS-01594440','01075', '', '', zip=FALSE)

rawSample2 <- importWQP(rawSampleURL_NoZip, zip=FALSE)

STORETex <- constructWQPURL('WIDNR_WQX-10032762','Specific conductance', '', '')

 STORETdata <- importWQP(STORETex)

dataRetrieval

Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data

v2.7.10
CC0
Authors
Laura DeCicco [aut, cre] (<https://orcid.org/0000-0002-3915-9487>), Robert Hirsch [aut] (<https://orcid.org/0000-0002-4534-075X>), David Lorenz [aut], Jordan Read [ctb], Jordan Walker [ctb], Lindsay Carr [ctb], David Watkins [aut] (<https://orcid.org/0000-0002-7544-0700>), David Blodgett [ctb], Mike Johnson [aut] (<https://orcid.org/0000-0002-5288-8350>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.