Learn R Programming

dataRetrieval (version 2.0.1)

readNWISmeas: Reads surface-water measurement data from NWISweb.

Description

Reads surface-water measurement data from NWISweb. Data is retrieved from http://waterdata.usgs.gov/nwis. See http://waterdata.usgs.gov/usa/nwis/sw for details about surface water.

Usage

readNWISmeas(siteNumbers, startDate = "", endDate = "", tz = "")

Arguments

siteNumbers
character USGS site number (or multiple sites). This is usually an 8 digit number
startDate
character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates retrieval for the earliest possible record.
endDate
character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates retrieval for the latest possible record.
tz
character to set timezone attribute of dateTime. Default is an empty quote, which converts the dateTimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). Possible values to provide are "America/New_York"

Value

  • A data frame with at least the following columns: lll{ Name Type Description agency_cd character The NWIS code for the agency reporting the data site_no character The USGS site number tz_cd character The time zone code for dateTime } See http://waterdata.usgs.gov/usa/nwis/sw for details about surface water, and http://waterdata.usgs.gov/nwis/help?output_formats_help#streamflow_measurement_data for help on the columns and codes. There are also several useful attributes attached to the data frame: lll{ 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 }

Examples

Run this code
siteNumbers <- c('01594440','040851325')
data <- readNWISmeas(siteNumbers)

Run the code above in your browser using DataLab