zbank

library("knitr")
library("zbank")
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
   lines <- options$output.lines
   if (is.null(lines)) {
     return(hook_output(x, options))  # pass to default hook
   }
   x <- unlist(strsplit(x, "\n"))
   more <- "..."
   if (length(lines)==1) {        # first n lines
     if (length(x) > lines) {
       # truncate the output, but add ....
       x <- c(head(x, lines), more)
     }
   } else {
     x <- c(if (abs(lines[1])>1) more else NULL,
            x[lines],
            if (length(x)>lines[abs(length(lines))]) more else NULL
           )
   }
   # paste these lines together
   x <- paste(c(x, ""), collapse = "\n")
   hook_output(x, options)
 })

knitr::opts_chunk$set(
  warning = FALSE,
  message = FALSE,
  collapse = TRUE,
  comment = "#>"
)

Project Status: Active - The project has reached a stable, usable state and is being actively developed. cran checks R-check codecov.io rstudio mirror downloads cran version

ZooBank API Client

ZooBank API Docs

See http://zoobank.org/Api

High vs. Low level package APIs

High level API

High level functions do the HTTP request and parse data to a data.frame for ease of downstream use. The high level functions have no underscore on the end of the function name, e.g., zb_name_usages

Low level API

The parsing to data.frame in the high level API does take extra time. The low level API only does the HTTP request, and gives back JSON without doing any more parsing. The low level functions DO have an underscore on the end of the function name, e.g., zb_name_usages_

Install

CRAN version

install.packages("zbank")

Development version

remotes::install_github("ropensci/zbank")
library("zbank")

Examples

Name usages

zb_name_usages(name = "Pseudanthias carlsoni")

Publications

zb_publications(query = "pyle")

Authors

zb_authors(query = "Schmutz")

Get info by any ZooBank identifier

zb_id(id = "6EA8BB2A-A57B-47C1-953E-042D8CD8E0E2")

Matching taxon name service

zb_matching(id = "FFF7160A-372D-40E9-9611-23AF5D9EAC4C")

ZooBank usage stats

zb_stats(start_date = "2018-03-01", end_date = "2018-04-01")

Meta

rofooter



ropenscilabs/zbank documentation built on Sept. 11, 2022, 7:55 a.m.