Description Usage Arguments Value Examples
Retrieves water use data from USGS Water Use Data for the Nation. See https://waterdata.usgs.gov/nwis/wu for more information. All available use categories for the supplied arguments are retrieved.
1 2 3 4 5 6 7 8 |
stateCd |
could be character (full name, abbreviation, id), or numeric (id). Only one is accepted per query. |
countyCd |
could be character (name, with or without "County", or "ALL"), numeric (id), or codeNULL, which will
return state or national data depending on the stateCd argument. |
years |
integer Years for data retrieval. Must be years ending in 0 or 5. Default is all available years. |
categories |
character categories of water use. Defaults to |
convertType |
logical defaults to |
transform |
logical only intended for use with national data. Defaults to |
A data frame with at least the year of record, and all available statistics for the given geographic parameters. County and state fields will be included as appropriate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #All data for a county
allegheny <- readNWISuse(stateCd = "Pennsylvania",countyCd = "Allegheny")
#Data for an entire state for certain years
ohio <- readNWISuse(years=c(2000,2005,2010),stateCd = "OH", countyCd = NULL)
#Data for an entire state, county by county
pr <- readNWISuse(years=c(2000,2005,2010),stateCd = "PR",countyCd="ALL")
#All national-scale data, transforming data frame to named columns from named rows
national <- readNWISuse(stateCd = NULL, countyCd = NULL, transform = TRUE)
#Washington, DC data
dc <- readNWISuse(stateCd = "DC",countyCd = NULL)
#data for multiple counties, with different input formatting
paData <- readNWISuse(stateCd = "42",countyCd = c("Allegheny County", "BUTLER", 1, "031"))
#retrieving two specific categories for an entire state
ks <- readNWISuse(stateCd = "KS", countyCd = NULL, categories = c("IT","LI"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.