Learn R Programming

dataRetrieval (version 2.0.1)

readNWISgwl: Reads groundwater level measurements from NWISweb.

Description

Reads groundwater level measurements from NWISweb. Mixed date/times come back from the service depending on the year that the data was collected. See http://waterdata.usgs.gov/usa/nwis/gw for details about groundwater. Groundwater dates and times are returned in many different formats, therefore the date/time information is returned as a character string. Users will need to convert to a date object. See http://waterservices.usgs.gov/rest/GW-Levels-Service.html for more information.

Usage

readNWISgwl(siteNumbers, startDate = "", endDate = "")

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.

Value

  • A data frame with 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 dateTime character The date and time of the value as a character dateTimeAccuracyCd character Information on the date/time accuracy censorCode character Censoring information sourceCode character Information on source of the data 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

Examples

Run this code
siteNumber <- "434400121275801"
data <- readNWISgwl(siteNumber, '','')
sites <- c("434400121275801", "375907091432201")
data2 <- readNWISgwl(sites, '','')

Run the code above in your browser using DataLab