Tidies water quality data downloaded from EMS database using the bcgov/rems package. It retains and renames required columns and sets the timezone to PST.
The data to tidy.
additional columns from the EMS data to retain specified as a character vector of column names that exist in the data. The dafault columns retained are:
"EMS_ID"
"MONITORING_LOCATION" (Renamed to "Station")
"COLLECTION_START" (Renamed to "DateTime")
"PARAMETER" (Renamed to "Variable")
"PARAMETER_CODE" (Renamed to "Code")
"RESULT" (Renamed to "Value")
"UNIT" (Renamed to "Units")
"METHOD_DETECTION_LIMIT" (Renamed to "DetectionLimit")
"RESULT_LETTER" (Renamed to "ResultLetter")
"SAMPLE_STATE"
"SAMPLE_CLASS"
"SAMPLE_DESCRIPTOR"
What to do with values below the detection limit. Options
are "zero"
(set the value to 0
; the default), #' "half"
(set the value
to half the MDL), "mdl"
(set the value to equal to the MDL), or "na"
(set
the value to NA
). Can also be set to "none"
to leave as is.
A tibble of the tidied rems data.
It sets values that are flagged as being less than the detection limit to zero. It does not alter values that are flagged as being greater than the detection limit - that is left up to the user.