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")
dt | data.frame output of |
---|---|
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:
|
# 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") # }dt <- read.csv(system.file("extdata", "testwq.csv", package = "dbhydroR")) clean_wq(dt)#> date __ FLAB08_CHLOROPHYLLA-SALINE_ug/L FLAB08_SALINITY_PSU #> 1 2011-03-21 NaN 0.196 28.40 #> 2 2011-04-11 NaN 0.276 29.10 #> 3 2011-05-09 NaN 0.328 34.30 #> 4 2011-06-07 NaN 0.329 38.50 #> 5 2011-07-05 NaN 0.402 38.20 #> 6 2011-08-08 NaN 0.907 35.10 #> 7 2011-09-06 NaN 0.887 23.80 #> 8 2011-10-06 NaN 0.573 21.10 #> 9 2011-12-08 NaN 0.369 22.90 #> 10 2012-02-02 NaN 0.260 27.60 #> 11 2012-04-05 NaN 0.509 29.70 #> 12 2012-06-11 NaN 0.751 10.70 #> 13 2012-08-15 NaN 1.900 6.07 #> 14 2012-10-16 NaN 1.910 17.30 #> 15 2012-12-12 NaN 0.984 24.30 #> 16 2013-02-11 NaN 1.190 28.60 #> 17 2013-04-23 NaN 0.802 30.90 #> FLAB09_CHLOROPHYLLA-SALINE_ug/L FLAB09_SALINITY_PSU #> 1 0.382 29.9 #> 2 0.289 30.6 #> 3 0.318 35.3 #> 4 0.407 38.6 #> 5 0.424 39.1 #> 6 0.760 41.4 #> 7 0.713 37.1 #> 8 0.593 39.3 #> 9 0.698 29.2 #> 10 0.507 30.8 #> 11 0.542 32.0 #> 12 0.584 23.1 #> 13 0.471 22.5 #> 14 0.310 24.6 #> 15 0.382 24.8 #> 16 0.336 29.1 #> 17 0.420 31.8