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

readNWISrating

Rating table for an active USGS streamgage retrieval


Description

Reads current rating table for an active USGS streamgage from NWISweb. Data is retrieved from https://waterdata.usgs.gov/nwis.

Usage

readNWISrating(siteNumber, type = "base", convertType = TRUE)

Arguments

siteNumber

character USGS site number. This is usually an 8 digit number

type

character can be "base", "corr", or "exsa"

convertType

logical, defaults to TRUE. If TRUE, the function will convert the data to dates, datetimes, numerics based on a standard algorithm. If false, everything is returned as a character

Value

A data frame. If type is "base," then the columns are INDEP, typically the gage height, in feet; DEP, typically the streamflow, in cubic feet per second; and STOR, where "*" indicates that the pair are a fixed point of the rating curve. If type is "exsa," then an additional column, SHIFT, is included that indicates the current shift in the rating for that value of INDEP. If type is "corr," then the columns are INDEP, typically the gage height, in feet; CORR, the correction for that value; and CORRINDEP, the corrected value for CORR.
If type is "base," then the data frame has an attribute called "RATING" that describes the rating curve is included.

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
comment character Header comments from the RDB file
siteInfo data.frame A data frame containing information on the requested sites
RATING character Rating information

Note

Not all active USGS streamgages have traditional rating curves that relate flow to stage.

See Also

Examples

site_id <- '01594440'

data <- readNWISrating(site_id, "base")
attr(data, "RATING")

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.