R/taxon_search.R

Defines functions taxon_search

Documented in taxon_search

#' Takes user input and obtains a query from iNaturalist using rinat
#' @name taxon_search
#' @description Takes user input and obtains a query from iNaturalist using rinat
#' @param taxon_of_interest prompts user for taxon of interest
#' @param year_of_interest prompts user for what year they want to search
#' @return search_output the output of the users search from iNaturalist
#' @export
#' @import rinat


taxon_search <- function(){
  taxon_of_interest <- readline(prompt = "What is your taxon of interest: ")
  year_of_interest <- as.numeric(readline(prompt = "What year do you want to look at: "))
  loadNamespace("rinat")
  iNaturalist_output <- rinat::get_inat_obs(taxon_name = taxon_of_interest, place_id=97394, geo=TRUE, year = year_of_interest)
  search_output<<- data.frame(iNaturalist_output)

}
Sammibulin/NaturalR documentation built on Dec. 18, 2021, 12:56 p.m.