BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

When multiple regions have no data occDetFunc appears to fail #197

Closed mlogie closed 1 month ago

mlogie commented 3 years ago

I've been running occupancy models using England, Scotland, Wales and NI as regions and GB and UK as aggregations. When species have no data in one region, this appears to throw a warning, but when species are missing data in two regions this seems to fail. I've run these models without error without regions included. I've attached a txt (which is really a csv) showing the number of records of each species within each region and whether or not that particular species failed to run occDetFunc. The error itself is a rather uninformative: simpleError in seq.default(mindat, maxdat, 1): 'from' must be a finite number

I also received these warnings: Warning message in min(current_r): “no non-missing arguments to min; returning Inf” Warning message in max(current_r): “no non-missing arguments to max; returning -Inf”

And finally @AugustT suggested that the issue may lie around about here: https://github.com/AugustT/sparta/blob/64f1cf1b168138d00ed388319ff9101ce037c303/R/occDetFunc.r#L452

failures.txt

DylanCarbone commented 1 month ago

This seems to be a duplicate of #198