Learn R Programming

dataRetrieval (version 2.0.1)

readNWISdata: General Data Import from NWIS

Description

Returns data from the NWIS web service. Arguments to the function should be based on http://waterservices.usgs.gov service calls.

Usage

readNWISdata(service = "dv", ...)

Arguments

service
string. Possible values are "iv" (for instantaneous), "dv" (for daily values), "gwlevels" (for groundwater levels), and "qwdata" (for water quality)
...
see http://waterservices.usgs.gov/rest/Site-Service.html#Service for a complete list of options

Value

  • A data frame with the following columns: lll{ Name Type Description agency character The NWIS code for the agency reporting the data site character The USGS site number datetime POSIXct The date and time of the value converted to UTC (for unit value data), character or raw character string tz_cd character The time zone code for datetime code character Any codes that qualify the corresponding value value numeric The numeric value for the parameter } Note that code and value are repeated for the parameters requested. The names are of the form X_D_P_S, where X is literal, D is an option description of the parameter, P is the parameter code, and S is the statistic code (if applicable). There are also several useful attributes attached to the data frame: lll{ Name Type Description url character The url used to generate the data siteInfo data.frame A data frame containing information on the requested sites variableInfo data.frame A data frame containing information on the requested parameters statisticInfo data.frame A data frame containing information on the requested statistics on the data queryTime POSIXct The time the data was returned }

See Also

renameNWISColumns, importWaterML1, importRDB1

Examples

Run this code
# Examples not run for time considerations
dataTemp <- readNWISdata(stateCd="OH",parameterCd="00010")
dataTempUnit <- readNWISdata(sites="03086500", service="iv", parameterCd="00010")
#Empty:
multiSite <- readNWISdata(sites=c("04025000","04072150"), service="iv", parameterCd="00010")
#Not empty:
multiSite <- readNWISdata(sites=c("04025500","040263491"), service="iv", parameterCd="00060")

Run the code above in your browser using DataLab