R/tsn_by_vernacular_language.R

Defines functions tsn_by_vernacular_language

Documented in tsn_by_vernacular_language

#' Get tsn by vernacular language
#'
#' @export
#' @inheritParams accepted_names
#' @param language A string containing the language. This is a language string,
#'    not the international language code (character)
#' @return a data.frame
#' @examples \dontrun{
#' tsn_by_vernacular_language(language = "french")
#' }
tsn_by_vernacular_language <- function(language, wt = "json", raw = FALSE, ...) {
  out <- itis_GET("getTsnByVernacularLanguage", list(language = language), wt, ...)
  if (raw || wt == "xml") return(out)
  x <- parse_raw(out)
  if (is.null(x$vernacularTsns) || inherits(x$vernacularTsns, "logical")) {
    tibble::tibble()
  } else {
    dr_op(tibble::as_tibble(x$vernacularTsns), "class")
  }
}

Try the ritis package in your browser

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

ritis documentation built on Feb. 2, 2021, 9:06 a.m.