Function occ_search in package rgbif provides means for restricting the result fields that are returned by the function using the parameter “fields = c(vector of field names to by returned)”. The problem with this is, that in the first step all result fields from the gbif api (like "https://api.gbif.org/v1/occurrence/search/?scientificName=Adonis%20vernalis&country=DE) a returned to the R instance. This means
- a big load of data is transported over the internet from the gbif api
- this takes quite some time (up to a few minutes)
- most of the data is then discarded, before the remaining fields of the fields-parameter are made available within the R environment.
Unfortunately, GBIF doesn’t allow you to select the data fields you want when requesting data. The
minimalparameter actually works after the data is returned into your R session. If you set
minimal=FALSEthen nothing is done and you get all data back, but if
minimal=TRUEonly a few fields are returned. This does help limit filling up your R memory
minimal=TRUEas other data fields are garbage collected, but the API call to GBIF would return faster I think if they would allow us to request specific fields. So I’ve contacted them and asked for this feature. We’ll wait and see what they say.
That was in 2014.
I have studied the api docs at GBIF occurrence API as well as the docs for the rgbif package in R and have not found any hint wether in the last 6 years an improvement of the gbif api been made.
Has anybody of the package developers or users of the rgbif package since in the meantime found a more economical way of using the gbif api?