converts the units for value, dl, and guidelines (if included) from the report generated by the API. The API report contains columns: Value, Unit, minGuideline, maxGuideline, Guideline Units

convert_units(wq_report_data, reporting_units = NULL)

Arguments

wq_report_data

either from get_wq_report_data or after calculate_guidelines

reporting_units

NULL or dataframe specifying the reporting units for various analytes. Columns should be Analyte, MediaType, reporting_units. Units for analytes not in the dataframe will not be converted.

Value

dataframe with Value, DL, minGuideline, maxGuideline replaced by values in new units. Unit column is replaced by new units and Guideline Unit column removed to avoid confusion