79090576

Date: 2024-10-15 15:10:56
Score: 1.5
Natty:
Report link

Thanks to the comment by @Grzegorz Sapijaszko I was able to resolve the issue. I had requested SIMPLE_CSV as the file format for download (as in many of the tutorials I had followed). However, the number of attributes available from a SIMPLE_CSV is limited. To get all available data, use DWCA as a method of download. This downloads data into multiple separate text files into a folder. Here is the updated code (also a simple tweak to make it more easily reproducible by saving the download number into a res object and changed the phylum to one with fewer species to speed up the example).

library(rgbif)
# Request data 
res<-occ_download(pred_and(pred("phylumKey", 13), pred("gadm","ETH")),
             format = "DWCA")#!!!! change SIMPLE_CSV to DWCA

# Check download status using occurrence number,
# see result in console from previous step
occ_download_wait(res)

# Load data
df <- occ_download_get(res) %>%
  occ_download_import()
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Grzegorz
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: kl-higgins