File: rank_names.R

package info (click to toggle)
r-cran-ritis 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,156 kB
  • sloc: sh: 13; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#' Provides a list of all the unique rank names contained in the database and
#'  their kingdom and rank ID values.
#'
#' @export
#' @inheritParams accepted_names
#' @return a data.frame, with columns:
#' \itemize{
#'  \item kingdomname
#'  \item rankid
#'  \item rankname
#' }
#' @examples \dontrun{
#' rank_names()
#' }
rank_names <- function(wt = "json", raw = FALSE, ...) {
  out <- itis_GET("getRankNames", list(), wt, ...)
  if (raw || wt == "xml") return(out)
  x <- parse_raw(out)$rankNames
  tibble::as_tibble(pick_cols(
    x,
    c("kingdomName", "rankId", "rankName")
  ))
}