Learn R Programming

dataRetrieval (version 2.5.1)

whatNWISdata: USGS data availability

Description

Imports a table of available parameters, period of record, and count. See http://waterservices.usgs.gov/rest/Site-Service.html for more information.

Usage

whatNWISdata(siteNumbers, service = "all", parameterCd = "all", statCd = "all")

Arguments

siteNumbers
character USGS site number or multiple sites.
service
character. Options are "all", or one or many of "dv"(daily values), "uv","rt", or "iv"(unit values), "qw"(water-quality),"sv"(sites visits),"pk"(peak measurements), "gw"(groundwater levels), "ad" (sites included in USGS Annual Water Data Reports External Link), "aw" (sites monitored by the USGS Active Groundwater Level Network External Link), "id" (historical instantaneous values)
parameterCd
character vector of valid parameter codes to return. Defaults to "all" which will not perform a filter.
statCd
character vector of all statistic codes to return. Defaults to "all" which will not perform a filter.

Value

A data frame with 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 Site name
site_tp_cd character
Site type dec_lat_va
numeric Decimal latitude
dec_long_va numeric
Decimal longitude coord_acy_cd
character Latitude-longitude accuracy
dec_coord_datum_cd character
Decimal Latitude-longitude datum alt_va
character Altitude of Gage or land surface
alt_acy_va character
Altitude accuracy alt_datum_cd
character Altitude datum
huc_cd character
Hydrologic unit code data_type_cd
character Data type
parm_cd character
Parameter code stat_cd
character Statistical code
dd_nu character
Internal database key loc_web_ds
character Additional measurement description
medium_grp_cd character
Medium group code parm_grp_cd
character Parameter group code
srs_id character
SRS ID access_cd
character Access code
begin_date Date
Begin date end_date
Date End date
count_nu integer
Record count parameter_group_nm
character Parameter group name
parameter_nm character
Parameter name casrn
character Chemical Abstracts Service (CAS) Registry Number
srsname character
Substance Registry Services parameter_units
character Parameter units
There are also several useful attributes attached to the data frame:
Name Type
Description url
character The url used to generate the data
comment character
Header comments from the RDB file queryTime
POSIXct The time the data was returned

Examples

Run this code
## Not run: 
# availableData <- whatNWISdata('05114000')
# # To find just unit value ('instantaneous') data:
# uvData <- whatNWISdata('05114000',service="uv")
# uvDataMulti <- whatNWISdata(c('05114000','09423350'),service=c("uv","dv"))
# siteNumbers <- c("01491000","01645000")
# flowAndTemp <- whatNWISdata(siteNumbers, parameterCd=c("00060","00010"))
# ## End(Not run)

Run the code above in your browser using DataLab