Created
January 24, 2024 13:56
-
-
Save PietrH/8256a415f48039378f7aeeee604a3664 to your computer and use it in GitHub Desktop.
Check if a species has an occurrence in Belgium using rgbif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
check_presence <- | |
function(scientificName = c('Vulpes vulpes', 'Pica pica'), | |
country = "BE") { | |
purrr::map( | |
scientificName, | |
~ rgbif::occ_data( | |
scientificName = .x, | |
country = country, | |
limit = 1 | |
)$data | |
) %>% | |
purrr::map_lgl( ~ nrow(.x) >= 1) %>% | |
tibble(present = ., scientificName = scientificName) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment