importNWISqw: Water-Quality Data

View source: R/importNWISqw.R

importNWISqwR Documentation

Water-Quality Data

Description

Imports discrete water-quality sample data from NWISweb.

Usage

importNWISqw(sites, params = "All", begin.date = "", end.date = "",
  keep = NULL, use.pnames = FALSE)

Arguments

sites

a vector of the USGS station identifiers.

params

A character string contains the name of a group of parameter codes, or a vector of parameter codes. See Details.

begin.date

the earliest date for data, must be a character with the format "YYYY-mm-dd."

end.date

the latest date for data, must be a character with the format "YYYY-mm-dd."

keep

a character vector for any additional columns to retain from the retrieved data.

use.pnames

create colummn names based on pcode (like P00000)? Default is to generate more English-like names.

Details

Valid parameter code groups are "All," or group codes:

Code Description
INF Information
PHY Physical
INM Inorganics, Major, Metals (major cations)
INN Inorganics, Major, Non-metals (major anions)
NUT Nutrient
MBI Microbiological
BIO Biological
IMN Inorganics, Minor, Non-metals
IMM Inorganics, Minor, Metals
TOX Toxicity
OPE Organics, pesticide
OPC Organics, PCBs
OOT Organics, other
RAD Radiochemical
SED Sediment
POP Population/community

Value

A data frame of the water-quality data of class "qw" organized by sample. Column names for the water-quality constituents are generated automatically, but can be set by the user, see makeColNames.

Note

The sample information columns that are automatically retained are the USGS station identifier, sample date, sample time, time zone code, and medium code. If composite samples are found in the data, then sample end date and sample end time are also included. Use the keep argument to retain more if needed.

NWIS has several remark codes that have special meaning in addition to "<," which indicates a left-censored value and ">," which indicates a right censored value. Most other codes are ignored in processing, but passed through and retained as the remark code in the data; a warning is printed when special remark codes are retained. NWIS also uses the remark code "M" to indicate whan a result value is rounded to 0. In that case, importNWISqw tries to recode the data as less than the reportiong level, but is the reporting level is the missing value NA, the remark code "M" is retained. Warnings are generated for both conversion and retention of the "M" remark codes.

References

Lorenz, D.L., 2014, smwrQW OFR.
See information about discrete samples at https://nwis.waterdata.usgs.gov/usa/nwis/qw.

See Also

readNWISqw

Examples


## Not run: 
importNWISqw("05330000", "00608") # Ammonia samples from the Minnesota River at Jordan.
Empty <- importNWISqw('05330000',c('00400','00403'),begin.date='2008-01-01')

## End(Not run)

USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.