R/get-species-aou.R

Defines functions get_species_aou

Documented in get_species_aou

#' Get BBS numerical code of a species
#'
#' Simply return the 4-5 digit BBS code for the given species.
#'
#' @param species Species List
#' @param sp_eng English name of species
#'
#' @return 4-5 digit AOU code for the given species, -1 if not found
#'
#' @keywords internal
#' @export
#'

get_species_aou <- function(species, sp_eng)
{
  aou <- NULL
  if (length(aou <- species[species$english == sp_eng, "sp.bbs"]) == 1)
  {
    return(aou)
  }else
  {
    return(-1)
  }
}

Try the bbsBayes package in your browser

Any scripts or data that you put into this service are public.

bbsBayes documentation built on March 7, 2023, 6:33 p.m.