USEPA / EPATADA

This R package can be used to compile and evaluate Water Quality Portal (WQP) data for samples collected from surface water monitoring sites on streams and lakes. It can be used to create applications that support water quality programs and help states, tribes, and other stakeholders efficiently analyze the data.
https://usepa.github.io/EPATADA/
Creative Commons Zero v1.0 Universal
40 stars 18 forks source link

The foramt of the reference table from EPATADA's TADA_GetSynonymRef function #509

Closed ycwwang closed 1 month ago

ycwwang commented 1 month ago

What is your question?

It seems like the EPATADA's TADA_GetSynonymRef returns a table that does not contain columns with unit information.

To Reproduce

The TADA's TADA_GetSynonymRef returns a data frame with 329 rows and 16 columns, but EPATADA's TADA_GetSynonymRef returns a data frame with only 11 columns. Five columns disappeared, and they are columns with unit information.

TADA_ref <- TADA::TADA_GetSynonymRef()

EPATADA_ref <- EPATADA::TADA_GetSynonymRef()

dim(TADA_ref)
# [1] 329  16

dim(EPATADA_ref)
# [1] 329  11

names(TADA_ref)[!names(TADA_ref) %in% names(EPATADA_ref)]
# [1] "TADA.ResultMeasure.MeasureUnitCode"        "Target.TADA.ResultMeasure.MeasureUnitCode"
# [3] "Target.TADA.UnitConversionFactor"          "Target.TADA.UnitConversionCoefficient"    
# [5] "TADA.UnitConversionRef"

Expected behavior

If the EPATADA package only aims to harmonzie the data based on the CharacteristicName and ResultSampleFractionText, the reference table could be in the correct format and the TADA_GetSynonymRef function works properly. However, the documentation still mentions that "TADA.ResultMeasure.MeasureUnitCode" should be in the table. Please check if the TADA_GetSynonymRef function works as expected.

hillarymarler commented 1 month ago

Thanks for reporting this issue. TADA_GetSynonymRef is working as expected as we've made some updates in recent months to handle unit conversions in a separate function that allows users to make parameter-specific conversion decisions (see https://usepa.github.io/EPATADA/reference/TADA_ConvertResultUnits.html).

However, as you noticed, the documentation still needs some updates to accurately reflect this change. I should be able to make those updates this week and will add a comment here when I do.