EPATADA icon indicating copy to clipboard operation
EPATADA copied to clipboard

In TADA_HarmonizeSynonyms, Harmonized = TRUE needs adjusting

Open elisehinman opened this issue 2 years ago • 3 comments

Describe the bug

Rows with fraction and speciation that need to be converted FROM some text TO NA are not flagged as HARMONIZED in the TADA.Harmonized.Flag column.

In TADA_HarmonizeSynonyms, @cristinamullin pointed out:

Also line 217, where targets are only assigned if NA. # find places where metadata will be changed and add targets harm.ref$TADA.Harmonized.Flag <- ifelse(!is.na(harm.ref$Target.TADA.CharacteristicName) | !is.na(harm.ref$Target.TADA.ResultSampleFractionText) | !is.na(harm.ref$Target.TADA.MethodSpecificationName) | !is.na(harm.ref$Target.TADA.ResultMeasure.MeasureUnitCode), TRUE, FALSE)

This needs to be adjusted to also catch situations where the fraction or speciation are converted to NA from something else. This could be run as a separate ifelse statement below this one that mirrors the logic used in line 246 of this function.

Reminders for TADA contributors addressing this issue

New features should include all of the following work:

  • [ ] Create the function/code.

  • [ ] Document all code using comments to describe what is does.

  • [ ] Create tests in tests folder.

  • [ ] Create help file using roxygen2 above code.

  • [ ] Create working examples in help file (via roxygen2).

  • [ ] Add to appropriate vignette (or create new one).

elisehinman avatar Sep 07 '23 13:09 elisehinman

@cristinamullin - it would make sense to work on this along with the pH harmonization issues (https://github.com/USEPA/TADA/issues/454)

hillarymarler avatar May 10 '24 19:05 hillarymarler