R/itis_kingdomnames.R

Defines functions itis_kingdomnames

Documented in itis_kingdomnames

#' Get kingdom names
#'
#' @export
#' @param tsn One or more TSN's (taxonomic serial number)
#' @param ... Further arguments passed on to getkingdomnamefromtsn
#' @examples \dontrun{
#' itis_kingdomnames(202385)
#' itis_kingdomnames(tsn=c(202385,183833,180543))
#' }
itis_kingdomnames <- function(tsn=NULL, ...) {
  if (is.null(tsn)) {
    ritis::kingdom_names(...)
  } else {
    sapply(
      tsn,
      function(z) {
        suppressWarnings(
          as.character(ritis::kingdom_name(z, ...)$kingdomname)
        )
      }
    )
  }
}

Try the taxize package in your browser

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

taxize documentation built on April 22, 2022, 9:07 a.m.