Limit columns in csv from API (R)

Hello !

I’m retrieving data from GBIF via the API in R and it’s working (thanks by the way =) )
But the file I’m retrieving is too big from my taste (and the memory of my computer).
Is it possible to limit the columns I’m receiving in my csv ?

My call looks like this :
data ← occ_download(pred_in(“taxonKey”, gbif_taxon_keys), pred(“hasCoordinate”, TRUE), format = “SIMPLE_CSV”,user=gbif_user, pwd=gbif_pwd, email=gbif_mail)

If possible, I would like to only download the following columns “species, decimalLongitude, decimalLatitude, gbifID, countryCode”.
(I can clean the csv myself, but it would be faster to not download it in the first place)

Thanking you in advance,

Florent.

Hi @flopet you could consider trying some SQL API download functions (which allows you to select specific columns). The documentation is available here: API SQL Downloads :: Technical Documentation and GBIF SQL Downloads • rgbif

1 Like

I agree with Marie that the SQL API is probably the easiest. You might also find the Parquet dump interesting.