library(rgbif)
library(dplyr)Data retrieval
Global Biodiversity Information Facility (GBIF)
Records of herbarium specimens of flowering plants collected in Guyana, Suriname, or French Guiana were retrieved from the GBIF.
Code
Load libraries:
Retrieve data:
# gbif_download <- occ_download(
# pred_in("country", countries),
# pred("taxonKey", "7707728"), # aNGIOSPERMS
# pred("basisOfRecord", "PRESERVED_SPECIMEN"),
# #pred("kingdom", "Plantae"),
# #pred("phylum", "Tracheophyta"),
# #pred("class", "Magnoliopsida"),
# pred("hasGeospatialIssue", FALSE),
# pred("hasCoordinate", TRUE),
# format = "SIMPLE_CSV",
# user = "YOUR USER NAME HERE",
# pwd = "YOUR PASSWORD HERE",
# email = "YOUR EMAIL HERE")
#
# # Wait for the download to finish
# occ_download_wait(gbif_download)
# Get download from GBIF into R:
# Get the download from GBIF
res <- occ_download_get(key="0000200-260129131611470", path= "../Data/GBIF", overwrite=TRUE)
# Import the data into R
gbif_Guianas<-occ_download_import(res)
totals<-gbif_Guianas %>%
group_by(family) %>%
summarise(N_genus = n_distinct(genus))
# Save file< only distinct ids
df_all<-gbif_Guianas %>%
distinct(scientificName, .keep_all = TRUE)
write.csv(df_all, "../Data/GBIF/GBIF_df_acc_and_synonyms.csv")