#' Creates a dataframe of geospatial data from GBIF
#'
#' Creates an easy to manipulate dataframe based on geospatial data from GBIF based on a vector of provided taxa.
#'
#' @param df A vector of taxa you want you want geospatial data on
#' @return return(Taxa_Frame %>% filter(!is.na(country)) Creates a data frame and removes rows where country is NA
#' @export Pull__Cort
Pull__Cort <-
function(taxvec){
ids <- c()
for (taxo in taxvec){
print(taxo)
cleaned <- name_suggest(taxo)
print(cleaned)
ids[taxo] <- c(cleaned$key)
}
df <- lapply(ids, occ_search, return = "data")
Taxa_Frame <- bind_rows(df, .id = "column_label")
return(Taxa_Frame %>% filter(!is.na(country)))
}
#This function requires tidyverse, dplyr, and rgbif libraries.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.