library(tidyverse)
# Example function of sending multiple scientificNames to rgbif::occ_data()
fetch_species_for_dimi <-
function(scientificName = c("Vulpes vulpes", "Puma concolor"),
country = "BE") {
purrr::map(
scientificName,
~ rgbif::occ_data(
scientificName = .x,
country = country,
limit = 100000
)$data
) %>%
list_rbind()
}
# Demo function
fetch_species_for_dimi()
#> # A tibble: 966 × 128
#> key scientificName decimalLatitude decimalLongitude issues datasetKey
#> <chr> <chr> <dbl> <dbl> <chr> <chr>
#> 1 4512254907 Vulpes vulpes … 50.8 4.43 cdc 50c9509d-…
#> 2 4018189241 Vulpes vulpes … 50.8 4.52 cdc,c… 50c9509d-…
#> 3 4022197800 Vulpes vulpes … 50.2 5.29 cdc,c… 50c9509d-…
#> 4 4441342189 Vulpes vulpes … 51.5 4.77 cdc,c… 8a5cbaec-…
#> 5 4441345688 Vulpes vulpes … 51.3 3.66 cdc,c… 8a5cbaec-…
#> 6 4063087300 Vulpes vulpes … 50.8 4.41 cdc,c… 50c9509d-…
#> 7 4111714982 Vulpes vulpes … 50.8 4.36 cdc,c… 50c9509d-…
#> 8 4080505750 Vulpes vulpes … 51.0 4.44 cdc,c… 50c9509d-…
#> 9 4080880532 Vulpes vulpes … 49.7 5.66 cdc,c… 50c9509d-…
#> 10 4091417639 Vulpes vulpes … 50.9 4.49 cdc,c… 50c9509d-…
#> # ℹ 956 more rows
#> # ℹ 122 more variables: publishingOrgKey <chr>, installationKey <chr>,
#> # hostingOrganizationKey <chr>, publishingCountry <chr>, protocol <chr>,
#> # lastCrawled <chr>, lastParsed <chr>, crawlId <int>, basisOfRecord <chr>,
#> # occurrenceStatus <chr>, lifeStage <chr>, taxonKey <int>, kingdomKey <int>,
#> # phylumKey <int>, classKey <int>, orderKey <int>, familyKey <int>,
#> # genusKey <int>, speciesKey <int>, acceptedTaxonKey <int>, …
Created on 2024-01-24 with reprex v2.0.2