tesselle / tabula

:bar_chart: Analysis and Visualization of Archaeological Count Data
https://packages.tesselle.org/tabula/
GNU General Public License v3.0
35 stars 5 forks source link

Bug: Mishandling of missing values #27

Closed akarlinsky closed 1 year ago

akarlinsky commented 1 year ago

Hi, thanks for a great package!

I encountered a bug with the way it handles missing values:

code to replicate error:

a <- c(1,1,NA,1)   
index_simpson(a)   
index_simpson(a, na.rm = T)   

Output (on both calls to index_simpson:

Error in if (!all(is_whole(x, ...))) { : 
  missing value where TRUE/FALSE needed
nfrerebeau commented 1 year ago

Thanks for pointing out this bug, it should work fine now.