Normalizes units for water quality parameters. Currently handles common conversions (mg/L to µg/L for phosphorus, unit standardization). Also validates expected unit ranges and emits warnings for values outside typical ranges.
Value
The input df with normalized units. Currently performs:
Validation of unit ranges (warns if values are outside typical ranges)
No actual conversions are performed (returns input unchanged)
Details
This function is designed as an extension point. Future versions may implement actual unit conversions based on metadata or user specifications.
Examples
df <- data.frame(ph = c(7, 7.2), od = c(6.5, 7.0), p_total = c(0.05, 0.08))
clean_units(df)
#> ph od p_total
#> 1 7.0 6.5 0.05
#> 2 7.2 7.0 0.08