Substitutes provided unit names for recognised units. Before matching all spaces and "units" or "UNITS" are removed. The case is not important. Where there are no matches missing values are returned.
substitute_units(x, messages = getOption("wqbc.messages", default = TRUE))
The character vector of units to substitute.
A flag indicating whether to print messages.
substitute_units(c("mg/L", "MG/L", "mg /L ", "Kg/l", "gkl"), messages = TRUE)
#> Substituted 'Kg/l' with 'kg/L', 'MG/L' with 'mg/L' and 'mg /L' with 'mg/L'.
#> Failed to substitute 'gkl'.
#> [1] "mg/L" "mg/L" "mg/L" "kg/L" NA