b-cubed-eu / indicator-uncertainty

Scripts to explore calculation, interpretation and visualisation of uncertainty related to indicators based on biodiversity data cubes
MIT License
0 stars 0 forks source link

Fix NULL value handling #9

Closed shawndove closed 2 weeks ago

shawndove commented 2 weeks ago

Fix the case where the first confidence interval is NULL, but at least one is not, which results in an error... this occurs because some lines in the function rely on this one not being NULL. This code removes the NULL list item(s) causing the error. It then exits the function if all list items were NULL.

wlangera commented 2 weeks ago

Hi Shawn

I fixed coding style so the check-project action passes.

I do not think we want to remove the NULL values. Because then we also use the year. And for the user it will not be clear where that year went. The fact that the code depends on the first element is probably not good.

I will propose a solution in a separate branch.

shawndove commented 2 weeks ago

Hi Shawn

I fixed coding style so the check-project action passes.

Thanks!

  • is there a specific reason that you use rlang::is_null() and not is.null()?

No particular reason. is.null() should be fine.

I do not think we want to remove the NULL values. Because then we also use the year. And for the user it will not be clear where that year went. The fact that the code depends on the first element is probably not good.

Good point!

I will propose a solution in a separate branch.

Seems to work, thanks.