Imports a table of available parameters, period of record, and count. See https://waterservices.usgs.gov/docs/site-service/ for more information.
Arguments
- ...
see https://waterservices.usgs.gov/docs/site-service/ for a complete list of options. A list of arguments can also be supplied.
- convertType
logical, defaults to
TRUE
. IfTRUE
, 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 with the following columns:
Name | Type | Description |
agency_cd | character | The NWIS code for the agency reporting the data |
site_no | character | The USGS site number |
station_nm | character | Site name |
site_tp_cd | character | Site type |
dec_lat_va | numeric | Decimal latitude |
dec_long_va | numeric | Decimal longitude |
coord_acy_cd | character | Latitude-longitude accuracy |
dec_coord_datum_cd | character | Decimal Latitude-longitude datum |
alt_va | character | Altitude of Gage or land surface |
alt_acy_va | character | Altitude accuracy |
alt_datum_cd | character | Altitude datum |
huc_cd | character | Hydrologic unit code |
data_type_cd | character | Data type |
parm_cd | character | Parameter code |
stat_cd | character | Statistical code |
dd_nu | character | Internal database key |
loc_web_ds | character | Additional measurement description |
medium_grp_cd | character | Medium group code |
parm_grp_cd | character | Parameter group code |
srs_id | character | SRS ID |
access_cd | character | Access code |
begin_date | Date | Begin date |
end_date | Date | End date |
count_nu | integer | Record count |
parameter_group_nm | character | Parameter group name |
parameter_nm | character | Parameter name |
casrn | character | Chemical Abstracts Service (CAS) Registry Number |
srsname | character | Substance Registry Services |
parameter_units | character | Parameter units |
There are also several useful attributes attached to the data frame:
Name | Type | Description |
url | character | The url used to generate the data |
comment | character | Header comments from the RDB file |
queryTime | POSIXct | The time the data was returned |
Details
This function requires users to create their own arguments
based on the NWIS web services. It is a more complicated function to use
compared to other NWIS functions such as readNWISdv
, readNWISuv
,
etc. However, this function adds a lot of
flexibility to the possible queries. If the "service" argument is included,
the results will be filtered to the proper data_type_cd. This is a great
function to use before a large data set, by filtering down the number
of sites that have useful data.
Examples
# \donttest{
availableData <- whatNWISdata(siteNumber = "05114000")
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&sites=05114000&format=rdb
#> WARNING: NWIS does not deliver
#> discrete water quality data newer than March 11, 2024
#> or updates to existing data. For additional details, see:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
# To find just unit value ('instantaneous') data:
uvData <- whatNWISdata(siteNumber = "05114000",
service = "uv")
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&sites=05114000&format=rdb
uvDataMulti <- whatNWISdata(siteNumber = c("05114000", "09423350"),
service = c("uv", "dv"))
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&sites=05114000,09423350&format=rdb
flowAndTemp <- whatNWISdata(
stateCd = "WI", service = "dv",
parameterCd = c("00060", "00010"),
statCd = "00003"
)
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&stateCd=WI&format=rdb
sites <- whatNWISdata(stateCd = "WI",
parameterCd = "00060",
siteType = "ST",
service = "site")
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&stateCd=WI&siteType=ST&format=rdb
#> WARNING: NWIS does not deliver
#> discrete water quality data newer than March 11, 2024
#> or updates to existing data. For additional details, see:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
sites <- whatNWISdata(stateCd = "WI",
service = "gwlevels")
#> GET: https://waterservices.usgs.gov/nwis/site/?seriesCatalogOutput=true&stateCd=WI&format=rdb
# }