R/get_vegtype.R

Defines functions get_vegtype

Documented in get_vegtype

#' Get the listed vegetation types for 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 vegtype.
#' @export
#' @examples
#' \dontrun{
#' taxa <- get.taxa(c("Myrcia guianensis", "bleh", "Xylopia", "Miconia albicans", "bleh", "Poa annua"))
#' get_vegtype(taxa)
#' }
get_vegtype <- function(taxa) {
    taxa <- dplyr::left_join(taxa, species.profiles[, c("id", "vegetation.type")], 
                            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.