ropensci / CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
https://docs.ropensci.org/CoordinateCleaner/
79 stars 21 forks source link

cc_outl throws error when all splist[test >= min_occs] #28

Closed pepbioalerts closed 4 years ago

pepbioalerts commented 5 years ago

when all species in the dataset do not pass the test of minimum occurrences splist <- splist[test >= min_occs] it returns a list without elements. The function is able to warn you and continue, however, if the method is quantile and there's a sampling threshold set (sampling_thresh > 0 ) then it troughs an error.

I have resolved the issue by adding if (sampling_thresh > 0 & length(flags)>0) {}

Just a suggestion Cheers, Pep

azizka commented 4 years ago

I could not reproduce it, but changes the structure of the if considition, so that this will not occur anymore as of version 2.0-14. Thanks