R/rt_taxa_taxrefhistory.R

Defines functions rt_taxa_taxrefhistory

Documented in rt_taxa_taxrefhistory

#' Retrieve history of a taxon through TAXREF versions
#'
#' @inheritParams rt_taxa_id
#'
#' @examples
#' \dontrun{rt_taxa_taxrefhistory(id = 443800)}
#'
#' @export
rt_taxa_taxrefhistory = function(id = NULL) {

  check_required_arg(id, "retrieve TAXREF history of a taxon using its id")

  stopifnot("'id' must be a numeric" = is.numeric(id))

  api_query = rt_GET("taxa/", id, "/taxrefHistory")

  parse_taxa(api_query)
}
Rekyt/rtaxref documentation built on June 18, 2022, 1:02 p.m.