Learn R Programming

waterData (version 1.0.8)

siteInfo: Retrieve site information

Description

Function to retrieve information about a USGS streamgage site

Usage

siteInfo(staid)

Arguments

staid
is a character vector containing USGS site identification number(s). USGS site numbers are usually eight digits long, but can be longer. Users may search for surface-water sites and obtain station identification numbers using the USGS Site Web Service, https://waterservices.usgs.gov/rest/Site-Service.html (U.S. Geological Survey, 2017b); using the National Water Information System: Mapper, https://maps.waterdata.usgs.gov/mapper/index.html (U.S. Geological Survey, 2017a); or using the National Water Information System: Web Interface to daily surface-water data, https://waterdata.usgs.gov/nwis/dv/?referred_module=sw (U.S. Geological Survey, 2017c). The site identification number needs to be entered as a character, that is in quotes, because many USGS streamgage numbers begin with zero and the leading zero is necessary.

Value

a data frame containing the station identification number(s), the USGS streamgage name(s), the decimal latitude(s), and decimal longitude(s).

Format

a data frame with the following columns:
Name Type Description staid
factor USGS station identification number staname character
USGS station name lat numeric Decimal latitude

Details

This provides some limited metadata about the USGS streamgage site.

References

U.S. Geological Survey, 2017a, National Water Information System: Mapper, accessed January 3, 2017, at https://maps.waterdata.usgs.gov/mapper/index.html. U.S. Geological Survey, 2017b, USGS site web service: REST Web Services, accessed January 3, 2017, at https://waterservices.usgs.gov/rest/Site-Service.html. U.S. Geological Survey, 2017c, USGS surface-water daily data for the Nation: National Water Information System: Web Interface, accessed January 3, 2017, at https://waterdata.usgs.gov/nwis/dv/?referred_module=sw.

Examples

Run this code
 ## Not run: ------------------------------------
# staInfo <- siteInfo("05054000")
# staInfo
# staInfo <- siteInfo(c("05054000", "05082500", "06342500"))
# staInfo
# # a list with an invalid station identification number
# staInfo <- siteInfo(c("05054000", "05082500", "0642501"))
#  
## ---------------------------------------------

Run the code above in your browser using DataLab