whatNWISsites: Site Data Import from NWIS

View source: R/whatNWISsites.R

whatNWISsitesR Documentation

Site Data Import from NWIS


Returns a list of sites from the NWIS web service. This function gets the data from: https://waterservices.usgs.gov/rest/Site-Test-Tool.html. Mapper format is used





see https://waterservices.usgs.gov/rest/Site-Service.html for a complete list of options. A list (or lists) can also be supplied. One way to figure out how to construct a WQP query is to go to the "Advanced" form in the Water Quality Portal: https://www.waterqualitydata.us/#mimeType=csv&providers=NWIS&providers=STEWARDS&providers=STORET Use the form to discover what parameters are available. Once the query is set in the form, scroll down to the "Query URL". You will see the parameters after "https://www.waterqualitydata.us/#". For example, if you chose "Nutrient" in the Characteristic Group dropdown, you will see characteristicType=Nutrient in the Query URL. The corresponding argument for dataRetrieval is characteristicType = "Nutrient". dataRetrieval users do not need to include mimeType, zip, and providers is optional (these arguments are picked automatically).


A data frame with at least the following columns:

Name Type Description
agency_cd character The NWIS code for the agency reporting the data
site_no character The USGS site number
station_nm character Station name
site_tp_cd character Site type code
dec_lat_va numeric Decimal latitude
dec_long_va numeric Decimal longitude
queryTime POSIXct Query time

There are also several useful attributes attached to the data frame:

Name Type Description
url character The url used to generate the data
queryTime POSIXct The time the data was returned


siteListPhos <- whatNWISsites(stateCd = "OH", parameterCd = "00665")
oneSite <- whatNWISsites(sites = "05114000")

dataRetrieval documentation built on Nov. 24, 2022, 1:06 a.m.