`sp_occurrence` obscure error when species not in GBIF
AMBarbosa opened this issue · 1 comments
AMBarbosa commented
If we misspell a taxon name, sp_occurrence
adequately returns 0 when download=FALSE
, i.e. zero records on GBIF for the specified taxon. But if download=TRUE
(the default), a puzzling error message appears:
sp_occurrence(genus = "Pathera", species = "leo", download = FALSE)
# [1] 0
sp_occurrence(genus = "Pathera", species = "leo")
# Error in sp_occurrence(genus = "Pathera", species = "leo") :
start <= end is not TRUE
Could it instead emit a message indicating what the problem is? Cheers!
rhijmans commented
Thanks, I now get:
s = sp_occurrence(genus = "Pathera", species = "leo")
#no records found
s
#NULL