Earliest Occurrence Records

I’m starting work on a project where we’re pulling information on the earliest records for a couple thousand species (with coordinates). I know the API supports greater than, less than, etc. But is there good way to “pre-sort” the results by date?

For reference, I’m usually using rgbif but I’m open to calling the API directly in R. Any ideas, folks?

There is no way to pre-sort occurrence records using the API.

Your solution will need window-through early years…

occ_search(taxonKey=212,search="year=1600,1700",limit=1000)$data %>% 
arrange(year) %>% 
select(year)

This will not be guaranteed to get the earliest records unless you make the window (“year=1600,1700”) small enough.

Depending on what your end goal is, it might be easier to use occ_download().

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.