convert2qw: Water-Quality Data

View source: R/convert2qw.R

convert2qwR Documentation

Water-Quality Data

Description

Converts information from discrete water-quality samples to data of class "qw." Attempts to construct the best-fit estimates for data of class "qw" from more limited data sources like just remark codes and values. But will also convert data created by as.data.frame(object of class qw, expand=TRUE).

Usage

convert2qw(data, scheme = "booker")

Arguments

data

a data frame that contains limited sample information.

scheme

a character string that describes the naming style of the variables in data that are to be conterted to class "qw." See Details.

Details

The options for scheme are "booker," "qw," and "partial." The "booker" naming scheme assumes that remark columns begin with "R" or "r" and the value columns begin with "P" or "p." That scheme is the most limited form because it forces missing values or blanks for almost all other of the meta data. The "qw" scheme assumes that the columns are named according to as.data.frame(object of class qw, expand=TRUE). The "partial" scheme assumes that the basic scheme from as.data.frame(object of class qw, expand=TRUE) is retained, but not all columns are required. Variations include no suffix for the value and .dl in lieu of .rlv for the detection limit. When .dl is used, the method detection limit is assumed to be "MDL" if not supplied. If the scheme is "partial," then at least the value and remark or detetion limit or reporting limit must be supplied.

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. Other columns are retained unchanged.

References

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

See Also

readNWISqw, makeColNames

Examples

# Make a dummy partial dataset
tmp.dum <- data.frame(sta=c("A", "B"),
 Val=c(1, 1.2),
 Val.rmk=c("<", ""),
 Val.dl=c(1, 1), stringsAsFactors=FALSE)
convert2qw(tmp.dum, scheme="partial")


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