R/get_domains.R

Defines functions get_domains

Documented in get_domains

#' Get the phytogeographic domain of a list of taxa
#'
#' @param taxa A data frame with taxon names as returned by get.taxa()
#'
#' @return A data frame as returned by get.taxa with an extra column named domain.
#' @export
#' @examples
#' \dontrun{
#' taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua"))
#' get_domains(taxa)
#' }
get_domains <- function(taxa) {
  taxa <- dplyr::left_join(taxa, distribution[, c("id", "domain")], 
                          by = "id")
  taxa
}

Try the flora package in your browser

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

flora documentation built on April 28, 2020, 9:05 a.m.