R/bhl_namesearch.R

Defines functions bhl_namesearch

Documented in bhl_namesearch

#' Search for a particular name.
#'
#' Names both with and without NameBank identifiers are returned.
#'
#' @export
#' @param name species name (character)
#' @inheritParams bhl_getcollections
#'
#' @examples \dontrun{
#' bhl_namesearch('poa annua')
#' bhl_namesearch(name='helianthus annuus')
#' bhl_namesearch(name='helianthus annuus', as='xml')
#' bhl_namesearch(name='helianthus annuus', as='json')
#' }

bhl_namesearch <- function(name = NULL, as = "table", key = NULL, ...) {
  args <- bhlc(list(op = "NameSearch", name = name, apikey = check_key(key),
                    format = as_f(as)))
  bhl_GET(as, args, ...)
}

Try the rbhl package in your browser

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

rbhl documentation built on May 13, 2021, 9:07 a.m.