EvolEcolGroup / tidysdm

R package to fit species distribution models (SDMs) using the 'tidymodels' framework
https://evolecolgroup.github.io/tidysdm/
GNU Affero General Public License v3.0
23 stars 6 forks source link

Improve warning message for attempting to sample more cells than are available #17

Closed jlapaijmans closed 1 year ago

jlapaijmans commented 1 year ago

When attempting to sample more pseudoabsences than there are cells on the map, the warning message is a bit spartan: there are fewer available cells in the raster than the requested n points. only 999 will be returned.

The warning message could be improved by including the time step and number of presences in that time step, as this will highlight potential issues in the data

for example: there are fewer available cells in the raster than the requested 1000 points for time slice -10000, containing 10 presences. only 999 will be returned

jlapaijmans commented 1 year ago

New warning message reads:

There are fewer available cells for raster 'NA' (3 presences) than the requested 100 pseudoabsences. Only 52 will be returned.