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

constructWQPURL

Construct WQP url for data retrieval


Description

Construct WQP url for data retrieval. This function gets the data from here: https://www.waterqualitydata.us

Usage

constructWQPURL(siteNumbers, parameterCd, startDate, endDate, zip = TRUE)

Arguments

siteNumbers

string or vector of strings USGS site number. This is usually an 8 digit number

parameterCd

string or vector of USGS parameter code. This is usually an 5 digit number.

startDate

character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates retrieval for the earliest possible record.

endDate

character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates retrieval for the latest possible record.

zip

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

Value

url string

Examples

site_id <- '01594440'
startDate <- '1985-01-01'
endDate <- ''
pCode <- c("00060","00010")
url_wqp <- constructWQPURL(paste("USGS",site_id,sep="-"),
           c('01075','00029','00453'),
           startDate,endDate)
url_wqp
charNames <- c("Temperature",
               "Temperature, sample",
               "Temperature, water",
               "Temperature, water, deg F")
obs_url_orig <- constructWQPURL(siteNumbers = c("IIDFG-41WSSPAHS",
                                                "USGS-02352560"), 
                                parameterCd = charNames,
                                startDate,"")
obs_url_orig

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.