Tidies water quality data downloaded from Environment Canada website. It is recommended to obtain the data via canwqdata::wq_site_data() or canwqdata::wq_basin_data() It retains and renames required columns and sets the timezone to PST.

tidy_ec_data(
  x,
  cols = character(0),
  mdl_action = c("zero", "mdl", "half", "na", "none")
)

Arguments

x

The data to tidy.

cols

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:

  • "SITE_NO"

  • "DATE_TIME_HEURE" (Renamed to "DateTime")

  • "VARIABLE" (Renamed to "Variable")

  • "VMV_CODE" (Renamed to "Code")

  • "VALUE_VALEUR" (Renamed to "Value")

  • "UNIT_UNITE" (Renamed to "Units")

  • "DSL_LDE" (Renamed to "DetectionLimit")

  • "FLAG_MARQUEUR" (Renamed to "ResultLetter")

mdl_action

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.

Value

A tibble of the tidied rems data.