clean_wq {dbhydroR}R Documentation

Clean raw water quality DBHYDRO data retrievals


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).


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



data.frame output of getwq


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


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


## 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"))

[Package dbhydroR version 0.2-8 Index]