File: search_scientific.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 (18 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#' Search by scientific name
#'
#' @export
#' @inheritParams accepted_names
#' @inheritParams any_match_count
#' @return a data.frame
#' @seealso \code{\link{search_common}}
#' @examples \dontrun{
#' search_scientific("Tardigrada")
#' search_scientific("Quercus douglasii")
#' }
search_scientific <- function(x, wt = "json", raw = FALSE, ...) {
  out <- itis_GET("searchByScientificName", list(srchKey = x), wt, ...)
  if (raw || wt == "xml") return(out)
  tibble::as_tibble(
    dr_op(parse_raw(out)$scientificNames, "class")
  )
}