importNWISqw: Water-Quality Data

Description Usage Arguments Details Value Note References See Also Examples

View source: R/smwrQW_x_importNWISqw.R


Imports discrete water-quality sample data from NWISweb.


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



a vector of the USGS station identifiers.


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

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

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


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


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


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


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.


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.


Lorenz, D.L., 2014, smwrQW OFR.
See information about discrete samples at

See Also



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

## End(Not run)

leppott/baytrends033 documentation built on July 28, 2018, 10:30 p.m.