VEuPathDB / microbiomeComputations

1 stars 0 forks source link

force continuous bin starts and ends to be numeric and handle nas #48

Closed asizemore closed 1 year ago

asizemore commented 1 year ago

Found that microbiomeComputations expects those bin starts and ends to be numeric but the data we receive has them as strings! So, ensure that if the comparator var is continuous then we coerce the bin starts and ends to numeric in order to perform all the rest of the logic.

Integration test: passed!

This PR does the following:

  1. uses the new as.numeric function from veupathUtils to coerce bin starts and ends to be numeric when it's a continuous variable
  2. removes any NAs found in the comparator variable before getting into the computation. I found having this step right at the top instead of inside the conditional easier to read and to check.