clean_wq: Clean raw water quality DBHYDRO data retrievals

Description Usage Arguments Examples

View source: R/dbhydro_clean.R

Description

Removes extra columns associated with QA flags and QA blanks which are used to check on potential sources of contamination. If raw is set to TRUE, get_wq results are converted from long (each piece of data on its own row) to wide format (each site x variable combination in its own column).

Usage

1
clean_wq(dt, raw = FALSE, mdl_handling = "raw")

Arguments

dt

data.frame output of getwq

raw

logical default is FALSE, set to TRUE to return data in "long" format with all comments, qa information, and database codes included

mdl_handling

character string specifying the handling of measurement values below the minimum detection limit (MDL). Example choices for this argument include:

  • raw: Returns values exactly as they are stored in the database. Current practice is to return values below the MDL as 0 minus the uncertainty estimate.

  • half: Returns values below the MDL as half the MDL

  • full: Returns values below the MDL as the MDL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
#check handling of values below MDL
dt <- getwq("FLAB01", "2014-09-14", "2014-09-18", "NITRATE+NITRITE-N",
 raw = TRUE)
clean_wq(dt, mdl_handling = "raw")
clean_wq(dt, mdl_handling = "half")

## End(Not run)

dt <- read.csv(system.file("extdata", "testwq.csv", package = "dbhydroR"))
clean_wq(dt)

dbhydroR documentation built on Feb. 22, 2021, 9:10 a.m.