File: global_species_completeness.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 (20 lines) | stat: -rw-r--r-- 649 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#' Get global species completeness from tsn
#'
#' @export
#' @inheritParams accepted_names
#' @template tsn
#' @examples \dontrun{
#' global_species_completeness(tsn = 180541)
#' global_species_completeness(180541, wt = "xml")
#' global_species_completeness(180541, wt = "json", raw = TRUE)
#' }
global_species_completeness <- function(tsn, wt = "json", raw = FALSE,
                                        ...) {

  out <- itis_GET("getGlobalSpeciesCompletenessFromTSN", list(tsn = tsn),
                  wt, ...)
  if (raw || wt == "xml") return(out)
  tibble::as_tibble(
    tc(pick_cols(parse_raw(out), c("completeness","rankId","tsn")))
  )
}