[med-svn] [r-cran-worrms] 04/06: New upstream version 0.1.0

Andreas Tille tille at debian.org
Mon Oct 2 10:57:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-cran-worrms.

commit 81ac9b5ae5ec899f535c28e048a6429783993ba1
Author: Andreas Tille <tille at debian.org>
Date:   Mon Oct 2 12:56:13 2017 +0200

    New upstream version 0.1.0
---
 DESCRIPTION                                 |  26 ++
 LICENSE                                     |   2 +
 MD5                                         |  62 ++++
 NAMESPACE                                   |  18 ++
 NEWS.md                                     |   6 +
 R/wm_children.R                             |  19 ++
 R/wm_classification.R                       |  31 ++
 R/wm_common_id.R                            |  14 +
 R/wm_distribution.R                         |  11 +
 R/wm_externalid.R                           |  29 ++
 R/wm_id2name.R                              |  11 +
 R/wm_name2id.R                              |  11 +
 R/wm_record.R                               |  11 +
 R/wm_record_by_external.R                   |  16 +
 R/wm_records_common.R                       |  29 ++
 R/wm_records_date.R                         |  23 ++
 R/wm_records_name.R                         |  30 ++
 R/wm_records_names.R                        |  24 ++
 R/wm_records_taxamatch.R                    |  23 ++
 R/wm_sources.R                              |  11 +
 R/wm_synonyms.R                             |  11 +
 R/worrms-package.R                          |  17 ++
 R/zzz.R                                     |  41 +++
 README.md                                   | 161 ++++++++++
 build/vignette.rds                          | Bin 0 -> 227 bytes
 debian/README.test                          |   8 -
 debian/changelog                            |   5 -
 debian/compat                               |   1 -
 debian/control                              |  30 --
 debian/copyright                            |  32 --
 debian/docs                                 |   3 -
 debian/rules                                |   5 -
 debian/source/format                        |   1 -
 debian/tests/control                        |   5 -
 debian/tests/run-unit-test                  |  17 --
 debian/watch                                |   2 -
 inst/doc/worrms_vignette.R                  |  55 ++++
 inst/doc/worrms_vignette.Rmd                | 129 ++++++++
 inst/doc/worrms_vignette.html               | 438 ++++++++++++++++++++++++++++
 man/wm_children.Rd                          |  26 ++
 man/wm_classification.Rd                    |  21 ++
 man/wm_common_id.Rd                         |  22 ++
 man/wm_distribution.Rd                      |  20 ++
 man/wm_external.Rd                          |  36 +++
 man/wm_id2name.Rd                           |  20 ++
 man/wm_name2id.Rd                           |  20 ++
 man/wm_record.Rd                            |  20 ++
 man/wm_record_by_external.Rd                |  24 ++
 man/wm_records_common.Rd                    |  30 ++
 man/wm_records_date.Rd                      |  28 ++
 man/wm_records_name.Rd                      |  30 ++
 man/wm_records_names.Rd                     |  26 ++
 man/wm_records_taxamatch.Rd                 |  27 ++
 man/wm_sources.Rd                           |  20 ++
 man/wm_synonyms.Rd                          |  20 ++
 man/worrms-package.Rd                       |  25 ++
 tests/test-all.R                            |   2 +
 tests/testthat/test-wm_children.R           |  41 +++
 tests/testthat/test-wm_classification.R     |  22 ++
 tests/testthat/test-wm_common_id.R          |  19 ++
 tests/testthat/test-wm_distribution.R       |  18 ++
 tests/testthat/test-wm_external.R           |  27 ++
 tests/testthat/test-wm_id2name.R            |  18 ++
 tests/testthat/test-wm_name2id.R            |  18 ++
 tests/testthat/test-wm_record.R             |  19 ++
 tests/testthat/test-wm_record_by_external.R |  34 +++
 tests/testthat/test-wm_records_common.R     |  44 +++
 tests/testthat/test-wm_records_date.R       |  19 ++
 tests/testthat/test-wm_records_name.R       |  33 +++
 tests/testthat/test-wm_records_names.R      |  34 +++
 tests/testthat/test-wm_records_taxamatch.R  |  24 ++
 tests/testthat/test-wm_sources.R            |  21 ++
 tests/testthat/test-wm_synonyms.R           |  23 ++
 vignettes/worrms_vignette.Rmd               | 129 ++++++++
 74 files changed, 2219 insertions(+), 109 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644
index 0000000..6b65d0b
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,26 @@
+Package: worrms
+Type: Package
+Title: World Register of Marine Species (WoRMS) Client
+Description: Client for World Register of Marine Species 
+    (<http://www.marinespecies.org/>). Includes functions for each
+    of the API methods, including searching for names by name, date and
+    common names, searching using external identifiers, fetching
+    synonyms, as well as fetching taxonomic children and 
+    taxonomic classification.
+Version: 0.1.0
+Authors at R: c(person("Scott", "Chamberlain", role = c("aut", "cre"),
+    email = "myrmecocystus at gmail.com"))
+License: MIT + file LICENSE
+URL: https://github.com/ropensci/worrms
+BugReports: https://github.com/ropensci/worrms/issues
+LazyData: true
+VignetteBuilder: knitr
+Imports: crul (>= 0.2.0), tibble (>= 1.2), jsonlite (>= 1.1)
+Suggests: roxygen2 (>= 5.0.1), knitr, rmarkdown, testthat, covr
+RoxygenNote: 5.0.1
+NeedsCompilation: no
+Packaged: 2017-01-13 20:56:33 UTC; sacmac
+Author: Scott Chamberlain [aut, cre]
+Maintainer: Scott Chamberlain <myrmecocystus at gmail.com>
+Repository: CRAN
+Date/Publication: 2017-01-14 12:46:41
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..37ee2c7
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,2 @@
+YEAR: 2017
+COPYRIGHT HOLDER: Scott Chamberlain
diff --git a/MD5 b/MD5
new file mode 100644
index 0000000..84c69d8
--- /dev/null
+++ b/MD5
@@ -0,0 +1,62 @@
+1fde29c1a5ba1b8f2abb9236c7cad728 *DESCRIPTION
+c5af52351472a750055a760a8924ce71 *LICENSE
+04cb8893de98cda8e2cf583029e25ca1 *NAMESPACE
+308d70e83a52437c58d2f0584ec0d055 *NEWS.md
+51cf7e89988d42e51a3da0454bf9e9bf *R/wm_children.R
+95be36d4a55ab3c719ed60ec46ee32eb *R/wm_classification.R
+5d42c6522ed5036684d28ebcc7d9dcc4 *R/wm_common_id.R
+6bb0a487189c106475a06cdf8d66c8fd *R/wm_distribution.R
+c13856cecc37519f5875e8b01f1e73cf *R/wm_externalid.R
+5fd8b370f92a476692271ae42d260bea *R/wm_id2name.R
+8a2d7b027d3197e8735c725fd1b09f5a *R/wm_name2id.R
+74420c3b84b1f32ca2734a8bd5052243 *R/wm_record.R
+453bc36ca20b6730b448efdb3935d07e *R/wm_record_by_external.R
+8170f3b89452f9d71731c0f19a6f4de1 *R/wm_records_common.R
+3599f42776cfdfdd25daf35a98b31703 *R/wm_records_date.R
+169ef5d8ccf5fcbcfea7ed3fe20e7828 *R/wm_records_name.R
+a6b2b826938c48934217e4b41990f80b *R/wm_records_names.R
+ef5634251cc7ded071d7d3bdf222213b *R/wm_records_taxamatch.R
+8b63bcb470d7830e76b38d6c82b451ac *R/wm_sources.R
+416a873f50b65053c1243c1b576a5692 *R/wm_synonyms.R
+305c77f60b73c1f59b7c37a8388410bd *R/worrms-package.R
+ca90085045ee6724292a67578903d2bb *R/zzz.R
+3a2002f17f1d857bfe243e890f55ab32 *README.md
+0d359f84d51353adf05eb4df9d6abb65 *build/vignette.rds
+874c3a48333db0b77d5db720b3c6c435 *inst/doc/worrms_vignette.R
+318ed891f3a8b6a130ea07f0a51eec7b *inst/doc/worrms_vignette.Rmd
+1ace7432185d2c9dcff64e5cf1894ce5 *inst/doc/worrms_vignette.html
+3c287959c038ef93335565292ea6dbb1 *man/wm_children.Rd
+c46affa245148b3578d89d458d848297 *man/wm_classification.Rd
+51a732e2a1ef339fa30e8510780bc78b *man/wm_common_id.Rd
+83d8e5e990fa10eb4b41999ff80de203 *man/wm_distribution.Rd
+4f34ed9b99b85c3d80ab9f0c2beeddfc *man/wm_external.Rd
+21bedcde1bf41f9ed2894eb6279ca91a *man/wm_id2name.Rd
+cf9782cb2b9c4c78093a5b394abc7260 *man/wm_name2id.Rd
+45d40ccddbc3e162ef2c789faef70313 *man/wm_record.Rd
+bc4e56a918c35a005460e7c9bfcb5159 *man/wm_record_by_external.Rd
+a7759bd5564ec2fe7217d94854cfecdc *man/wm_records_common.Rd
+094d6e59c574e35032f3548f46c292a8 *man/wm_records_date.Rd
+8576a477ca3e6cb214ab130755a37569 *man/wm_records_name.Rd
+8606a516eab50196ffb2e68e9c4c436b *man/wm_records_names.Rd
+7bc0516d37d76bebc6a391bad0885ec5 *man/wm_records_taxamatch.Rd
+0ce9123e823dacb86cdd0232b36c0c99 *man/wm_sources.Rd
+873fef0b6560d61a1114b811527b87d4 *man/wm_synonyms.Rd
+394917f77183e80c6e7ae0d2455a1874 *man/worrms-package.Rd
+8c7030aa348e0a2b9cb58ff224192b05 *tests/test-all.R
+e7f63445dfae8ab1e99fae6a1dabe469 *tests/testthat/test-wm_children.R
+78dec117cc8ea1c374e182e828506f59 *tests/testthat/test-wm_classification.R
+d9849a499a932e0b5f3eccaec9ffa165 *tests/testthat/test-wm_common_id.R
+9c8c3babdb233166ee0d48a1be23eb43 *tests/testthat/test-wm_distribution.R
+d5c245384ed89d2ebcb6eade6349334a *tests/testthat/test-wm_external.R
+6cd7473b74fbf51bd97e33a1801febc6 *tests/testthat/test-wm_id2name.R
+64afb3ada77c223bb4131791a98a200c *tests/testthat/test-wm_name2id.R
+73980964694ebd4a28505af11d13c262 *tests/testthat/test-wm_record.R
+08bdf61c059b7974280d8243d1e895ab *tests/testthat/test-wm_record_by_external.R
+863bd7a5772d23f1e8a784a727edb6d6 *tests/testthat/test-wm_records_common.R
+940457feed462710141f16834ed768fe *tests/testthat/test-wm_records_date.R
+77d27c7b71d6c6e37ddc3214cf6472a8 *tests/testthat/test-wm_records_name.R
+a4b3f48df5bdeaa7de22e49b57660787 *tests/testthat/test-wm_records_names.R
+86f804037d073d3dda9d28cede013496 *tests/testthat/test-wm_records_taxamatch.R
+d2f53f5e76a8527ee6e82a1a7f87d329 *tests/testthat/test-wm_sources.R
+b699cb573f3788fc98a1746112a798a0 *tests/testthat/test-wm_synonyms.R
+318ed891f3a8b6a130ea07f0a51eec7b *vignettes/worrms_vignette.Rmd
diff --git a/NAMESPACE b/NAMESPACE
new file mode 100644
index 0000000..8aa2a34
--- /dev/null
+++ b/NAMESPACE
@@ -0,0 +1,18 @@
+# Generated by roxygen2: do not edit by hand
+
+export(wm_children)
+export(wm_classification)
+export(wm_common_id)
+export(wm_distribution)
+export(wm_external)
+export(wm_id2name)
+export(wm_name2id)
+export(wm_record)
+export(wm_record_by_external)
+export(wm_records_common)
+export(wm_records_date)
+export(wm_records_name)
+export(wm_records_names)
+export(wm_records_taxamatch)
+export(wm_sources)
+export(wm_synonyms)
diff --git a/NEWS.md b/NEWS.md
new file mode 100644
index 0000000..ed5a563
--- /dev/null
+++ b/NEWS.md
@@ -0,0 +1,6 @@
+worrms 0.1.0
+============
+
+### NEW FEATURES
+
+* Released to CRAN.
diff --git a/R/wm_children.R b/R/wm_children.R
new file mode 100644
index 0000000..b3d8e9e
--- /dev/null
+++ b/R/wm_children.R
@@ -0,0 +1,19 @@
+#' Get children for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @param marine_only (logical) marine only or not. default: \code{TRUE}
+#' @param offset (integer) record to start at. default: 1
+#' @template curl
+#' @examples
+#' wm_children(id = 105706)
+#' wm_children(id = 105706, FALSE)
+#' wm_children(id = 105706, offset = 5)
+wm_children <- function(id, marine_only = TRUE, offset = 1, ...) {
+  assert(id, c("numeric", "integer"))
+  assert(marine_only, "logical")
+  assert(offset, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaChildrenByAphiaID", id),
+         query = cc(list(marine_only = as_log(marine_only),
+                         offset = offset)), ...)
+}
diff --git a/R/wm_classification.R b/R/wm_classification.R
new file mode 100644
index 0000000..1b53125
--- /dev/null
+++ b/R/wm_classification.R
@@ -0,0 +1,31 @@
+#' Get classification for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_classification(id = 105706)
+#' wm_classification(id = 126436)
+wm_classification <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  res <- wm_GET(file.path(wm_base(), "AphiaClassificationByAphiaID", id), ...)
+  done <- FALSE
+  out <- list()
+  it <- 0
+  while (!done) {
+    it <- it + 1
+    ch <- res$child
+    if (!is.null(ch)) {
+      out[[it]] <- ch[!names(ch) %in% "child"]
+      res <- list(child = ch$child)
+    } else {
+      done <- TRUE
+    }
+  }
+  dat <- Filter(function(x) !is.null(x) && length(x) != 0, out)
+  dat <- do.call("rbind.data.frame", dat)
+  dat$rank <- as.character(dat$rank)
+  dat$scientificname <- as.character(dat$scientificname)
+  if (NROW(dat) == 0) dat <- NULL
+  tibble::as_tibble(dat)
+}
diff --git a/R/wm_common_id.R b/R/wm_common_id.R
new file mode 100644
index 0000000..e85e749
--- /dev/null
+++ b/R/wm_common_id.R
@@ -0,0 +1,14 @@
+#' Get vernacular names from an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_common_id(id = 105706)
+#' wm_common_id(id = 156806)
+#' wm_common_id(id = 397065)
+wm_common_id <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  if (length(id) > 1) stop("'id' must be of length 1", call. = FALSE)
+  wm_GET(file.path(wm_base(), "AphiaVernacularsByAphiaID", id), ...)
+}
diff --git a/R/wm_distribution.R b/R/wm_distribution.R
new file mode 100644
index 0000000..70fd224
--- /dev/null
+++ b/R/wm_distribution.R
@@ -0,0 +1,11 @@
+#' Get distribution data by AphiaID
+#'
+#' @export
+#' @param id an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_distribution(id = 156806)
+wm_distribution <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaDistributionsByAphiaID", id), ...)
+}
diff --git a/R/wm_externalid.R b/R/wm_externalid.R
new file mode 100644
index 0000000..e3086bb
--- /dev/null
+++ b/R/wm_externalid.R
@@ -0,0 +1,29 @@
+#' Get an external ID via an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @param type (character) the type of external id. one of: tsn, bold,
+#' dyntaxa, eol, fishbase, iucn, lsid, ncbi, gisd. default: tsn
+#' @template curl
+#' @examples
+#' # by default, get a TSN (an ITIS code)
+#' wm_external(id = 1080)
+#'
+#' # BOLD code
+#' wm_external(id = 278468, type = "bold")
+#'
+#' # NCBI code
+#' wm_external(id = 278468, type = "ncbi")
+#'
+#' # fishbase code
+#' wm_external(id = 278468, type = "fishbase")
+#'
+#' library(crul)
+#' wm_external(id = 105706, verbose = TRUE)
+wm_external <- function(id, type = "tsn", ...) {
+  assert(id, c("numeric", "integer"))
+  assert(type, "character")
+  as.integer(wm_GET(
+    file.path(wm_base(), "AphiaExternalIDByAphiaID", id),
+    query = cc(list(type = type)), ...))
+}
diff --git a/R/wm_id2name.R b/R/wm_id2name.R
new file mode 100644
index 0000000..865ea5e
--- /dev/null
+++ b/R/wm_id2name.R
@@ -0,0 +1,11 @@
+#' Get taxonomic name for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_id2name(id = 105706)
+wm_id2name <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaNameByAphiaID", id), ...)
+}
diff --git a/R/wm_name2id.R b/R/wm_name2id.R
new file mode 100644
index 0000000..e058e20
--- /dev/null
+++ b/R/wm_name2id.R
@@ -0,0 +1,11 @@
+#' Get AphiaID from a taxonomic name
+#'
+#' @export
+#' @param name (character) a taxon name
+#' @template curl
+#' @examples
+#' wm_name2id(name = "Rhincodon")
+wm_name2id <- function(name, ...) {
+  assert(name, "character")
+  wm_GET(file.path(wm_base(), "AphiaIDByName", name), ...)
+}
diff --git a/R/wm_record.R b/R/wm_record.R
new file mode 100644
index 0000000..6edb4fc
--- /dev/null
+++ b/R/wm_record.R
@@ -0,0 +1,11 @@
+#' Get complete AphiaRecord for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_record(id = 105706)
+wm_record <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaRecordByAphiaID", id), ...)
+}
diff --git a/R/wm_record_by_external.R b/R/wm_record_by_external.R
new file mode 100644
index 0000000..dc09a40
--- /dev/null
+++ b/R/wm_record_by_external.R
@@ -0,0 +1,16 @@
+#' Get record by external ID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @param type (character) the type of external id. one of: tsn, bold,
+#' dyntaxa, eol, fishbase, iucn, lsid, ncbi, gisd. default: tsn
+#' @template curl
+#' @examples
+#' wm_record_by_external(id = 85257)
+#' wm_record_by_external(id = 159854)
+wm_record_by_external <- function(id, type = "tsn", ...) {
+  assert(id, c("numeric", "integer"))
+  assert(type, "character")
+  wm_GET(file.path(wm_base(), "AphiaRecordByExternalID", id),
+         query = cc(list(type = type)), ...)
+}
diff --git a/R/wm_records_common.R b/R/wm_records_common.R
new file mode 100644
index 0000000..b821f62
--- /dev/null
+++ b/R/wm_records_common.R
@@ -0,0 +1,29 @@
+#' Get records by vernacular name, optional fuzzy matching
+#'
+#' @export
+#' @param name (character) a species common name. required.
+#' @param fuzzy (logical) fuzzy search. default: \code{FALSE}
+#' @param offset (integer) record to start at. default: 1
+#' @template curl
+#' @examples
+#' wm_records_common(name = 'dolphin')
+#' wm_records_common(name = 'clam')
+#'
+#' \dontrun{
+#' wm_records_common(name = 'dolphin', fuzzy = TRUE)
+#' wm_records_common(name = 'clam', fuzzy = TRUE, offset = 5)
+#' }
+wm_records_common <- function(name, fuzzy = FALSE, offset = 1,
+                            ...) {
+  assert(name, "character")
+  assert(fuzzy, "logical")
+  assert(offset, c('numeric', 'integer'))
+
+  if (length(name) > 1) stop("'name' must be of length 1", call. = FALSE)
+  args <- cc(list(
+    like = as_log(fuzzy),
+    offset = offset
+  ))
+  wm_GET(file.path(wm_base(), "AphiaRecordsByVernacular", name),
+         query = args, ...)
+}
diff --git a/R/wm_records_date.R b/R/wm_records_date.R
new file mode 100644
index 0000000..3e6dab4
--- /dev/null
+++ b/R/wm_records_date.R
@@ -0,0 +1,23 @@
+#' Get records by date
+#'
+#' @export
+#' @param start_date (character) start date. required.
+#' @param end_date (character) end date. optional
+#' @param marine_only (logical) marine only or not. default: \code{TRUE}
+#' @param offset (integer) record to start at. default: 1
+#' @template curl
+#' @examples
+#' a_date <- format(Sys.Date() - 1, "%Y-%m-%dT%H:%M:%S+00:00")
+#' wm_records_date(a_date)
+wm_records_date <- function(start_date, end_date = NULL, marine_only = TRUE,
+                            offset = 1, ...) {
+  assert(start_date, c("character", "Date"))
+  assert(end_date, c("character", "Date"))
+  assert(marine_only, "logical")
+  assert(offset, c('numeric', 'integer'))
+
+  wm_GET(file.path(wm_base(), "AphiaRecordsByDate"),
+         query = cc(list(
+           startdate = start_date, enddate = end_date,
+           marine_only = as_log(marine_only), offset = offset)), ...)
+}
diff --git a/R/wm_records_name.R b/R/wm_records_name.R
new file mode 100644
index 0000000..c97b106
--- /dev/null
+++ b/R/wm_records_name.R
@@ -0,0 +1,30 @@
+#' Get records by single name, optional fuzzy matching
+#'
+#' @export
+#' @param name (character) start date. required.
+#' @param fuzzy (logical) fuzzy search. default: \code{TRUE}
+#' @param marine_only (logical) marine only or not. default: \code{TRUE}
+#' @param offset (integer) record to start at. default: 1
+#' @template curl
+#' @examples
+#' wm_records_name(name = 'Platanista gangetica')
+#' wm_records_name(name = 'Platanista gangetica', fuzzy = FALSE)
+#' wm_records_name(name = 'Platanista gangetica', marine_only = FALSE)
+#' wm_records_name(name = 'Platanista', marine_only = FALSE)
+#' wm_records_name(name = 'Platanista', marine_only = FALSE, offset = 5)
+wm_records_name <- function(name, fuzzy = TRUE, marine_only = TRUE, offset = 1,
+                            ...) {
+  assert(name, "character")
+  assert(fuzzy, "logical")
+  assert(marine_only, "logical")
+  assert(offset, c('numeric', 'integer'))
+
+  if (length(name) > 1) stop("'name' must be of length 1", call. = FALSE)
+  args <- cc(list(
+    like = as_log(fuzzy),
+    marine_only = as_log(marine_only),
+    offset = offset
+  ))
+  wm_GET(file.path(wm_base(), "AphiaRecordsByName", name),
+         query = args, ...)
+}
diff --git a/R/wm_records_names.R b/R/wm_records_names.R
new file mode 100644
index 0000000..58f2bf6
--- /dev/null
+++ b/R/wm_records_names.R
@@ -0,0 +1,24 @@
+#' Get records for onen or more taxonomic name(s)
+#'
+#' @export
+#' @param name (character) start date. required.
+#' @param fuzzy (logical) fuzzy search. default: \code{FALSE}
+#' @param marine_only (logical) marine only or not. default: \code{TRUE}
+#' @template curl
+#' @examples
+#' wm_records_names(name = 'Platanista gangetica')
+#' wm_records_names(name = 'Platanista gangetica', fuzzy = TRUE)
+#' wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+wm_records_names <- function(name, fuzzy = FALSE, marine_only = TRUE, ...) {
+  assert(name, "character")
+  assert(fuzzy, "logical")
+  assert(marine_only, "logical")
+
+  args <- cc(list(like = as_log(fuzzy), marine_only = as_log(marine_only)))
+  args <- c(args,
+            stats::setNames(as.list(name),
+                            rep('scientificnames[]',
+                                length(name))))
+  wm_GET(file.path(wm_base(), "AphiaRecordsByNames"),
+         query = args, ...)
+}
diff --git a/R/wm_records_taxamatch.R b/R/wm_records_taxamatch.R
new file mode 100644
index 0000000..e33ab1e
--- /dev/null
+++ b/R/wm_records_taxamatch.R
@@ -0,0 +1,23 @@
+#' Get records for onen or more taxonomic name(s) using
+#' the TAXAMATCH fuzzy matching algorithm
+#'
+#' @export
+#' @param name (character) taxon name. required.
+#' @param marine_only (logical) marine only or not. default: \code{TRUE}
+#' @template curl
+#' @examples \dontrun{
+#' wm_records_taxamatch(name = 'Platanista gangetica')
+#' wm_records_taxamatch(name = c('Platanista gangetica', 'Coryphaena'))
+#' }
+wm_records_taxamatch <- function(name, marine_only = TRUE, ...) {
+  assert(name, "character")
+  assert(marine_only, "logical")
+
+  args <- cc(list(marine_only = as_log(marine_only)))
+  args <- c(args,
+            stats::setNames(as.list(name),
+                            rep('scientificnames[]',
+                                length(name))))
+  wm_GET(file.path(wm_base(), "AphiaRecordsByMatchNames"),
+         query = args, ...)
+}
diff --git a/R/wm_sources.R b/R/wm_sources.R
new file mode 100644
index 0000000..bae4e8d
--- /dev/null
+++ b/R/wm_sources.R
@@ -0,0 +1,11 @@
+#' Get sources for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_sources(id = 105706)
+wm_sources <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaSourcesByAphiaID", id), ...)
+}
diff --git a/R/wm_synonyms.R b/R/wm_synonyms.R
new file mode 100644
index 0000000..52ee84b
--- /dev/null
+++ b/R/wm_synonyms.R
@@ -0,0 +1,11 @@
+#' Get synonyms for an AphiaID
+#'
+#' @export
+#' @param id (numeric/integer) an AphiaID. required.
+#' @template curl
+#' @examples
+#' wm_synonyms(id = 105706)
+wm_synonyms <- function(id, ...) {
+  assert(id, c("numeric", "integer"))
+  wm_GET(file.path(wm_base(), "AphiaSynonymsByAphiaID", id), ...)
+}
diff --git a/R/worrms-package.R b/R/worrms-package.R
new file mode 100644
index 0000000..bba7bd4
--- /dev/null
+++ b/R/worrms-package.R
@@ -0,0 +1,17 @@
+#' World Register of Marine Species Client
+#'
+#' @name worrms-package
+#' @aliases worrms
+#' @docType package
+#' @keywords package
+#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
+#'
+#' @section Fail behavior:
+#' The WoRMS REST API doesn't have sophisticated error messaging, so
+#' most errors will result in a \code{(204) - No Content} or
+#' in \code{(400) - Bad Request}
+#'
+#' Because WoRMS doesn't do comprehensive error reporting, we do a fair
+#' amount of checking user inputs to help prevent errors that will be
+#' meaningless to the user. Let us know if we can improve on this.
+NULL
diff --git a/R/zzz.R b/R/zzz.R
new file mode 100644
index 0000000..3433bef
--- /dev/null
+++ b/R/zzz.R
@@ -0,0 +1,41 @@
+wm_GET <- function(url, query = list(), ...) {
+  cli <- crul::HttpClient$new(url = url, opts = list(...))
+  temp <- cli$get(query = query)
+  temp$raise_for_status()
+  if (temp$status_code == 204) {
+    stop(sprintf("(%s) %s", temp$status_code, temp$status_http()$message), call. = FALSE)
+  }
+  tmp <- jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
+  if (inherits(tmp, "data.frame")) {
+    tibble::as_data_frame(tmp)
+  } else if (inherits(tmp, "list")) {
+    if (all(sapply(tmp, class) == "data.frame")) {
+      lapply(tmp, tibble::as_data_frame)
+    } else {
+      tmp
+    }
+  } else {
+    tmp
+  }
+}
+
+wm_base <- function() "http://www.marinespecies.org/rest"
+
+cc <- function(x) Filter(Negate(is.null), x)
+
+as_log <- function(x) {
+  if (is.null(x)) {
+    x
+  } else {
+    if (x) "true" else "false"
+  }
+}
+
+assert <- function(x, y) {
+  if (!is.null(x)) {
+    if (!class(x) %in% y) {
+      stop(deparse(substitute(x)), " must be of class ",
+           paste0(y, collapse = ", "), call. = FALSE)
+    }
+  }
+}
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5536917
--- /dev/null
+++ b/README.md
@@ -0,0 +1,161 @@
+worrms
+======
+
+
+
+<!-- README.md is generated from README.Rmd. Please edit that file -->
+
+[![Build Status](https://travis-ci.org/ropensci/worrms.svg?branch=master)](https://travis-ci.org/ropensci/worrms)
+[![codecov](https://codecov.io/gh/ropensci/worrms/branch/master/graph/badge.svg)](https://codecov.io/gh/ropensci/worrms)
+
+`worrms` is a R client for the World Register of Marine Species
+
+* [World Register of Marine Species (WoRMS)](http://www.marinespecies.org/)
+* [WoRMS REST API docs](http://www.marinespecies.org/rest/)
+
+## Installation
+
+More stable CRAN version
+
+
+```r
+install.packages("worrms")
+```
+
+Development version
+
+
+```r
+devtools::install_github("ropensci/worrms")
+```
+
+
+```r
+library("worrms")
+```
+
+## get records
+
+by date
+
+
+```r
+wm_records_date('2016-12-23T05:59:45+00:00')
+#> # A tibble: 50 × 25
+#>    AphiaID                                                           url
+#> *    <int>                                                         <chr>
+#> 1   894298 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894298
+#> 2   894301 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894301
+#> 3   894297 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894297
+#> 4   894302 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894302
+#> 5   894296 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894296
+#> 6   894299 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894299
+#> 7   894303 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894303
+#> 8   906769 http://www.marinespecies.org/aphia.php?p=taxdetails&id=906769
+#> 9   909454 http://www.marinespecies.org/aphia.php?p=taxdetails&id=909454
+#> 10  915236 http://www.marinespecies.org/aphia.php?p=taxdetails&id=915236
+#> # ... with 40 more rows, and 23 more variables: scientificname <chr>,
+#> #   authority <chr>, status <chr>, unacceptreason <lgl>, rank <chr>,
+#> #   valid_AphiaID <int>, valid_name <chr>, valid_authority <chr>,
+#> #   kingdom <chr>, phylum <chr>, class <chr>, order <chr>, family <chr>,
+#> #   genus <chr>, citation <chr>, lsid <chr>, isMarine <int>,
+#> #   isBrackish <lgl>, isFreshwater <lgl>, isTerrestrial <lgl>,
+#> #   isExtinct <int>, match_type <chr>, modified <chr>
+```
+
+by a taxonomic name
+
+
+```r
+wm_records_name(name = 'Platanista gangetica')
+#> # A tibble: 3 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> 2  383571 http://www.marinespecies.org/aphia.php?p=taxdetails&id=383571
+#> 3  254969 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254969
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <int>, isExtinct <lgl>, match_type <chr>, modified <chr>
+```
+
+by many names
+
+
+```r
+wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+#> [[1]]
+#> # A tibble: 1 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <lgl>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr>
+#> 
+#> [[2]]
+#> # A tibble: 2 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  125960 http://www.marinespecies.org/aphia.php?p=taxdetails&id=125960
+#> 2  843430                                                          <NA>
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <chr>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <int>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr>
+```
+
+by common name
+
+
+```r
+wm_records_common(name = 'clam')
+#> # A tibble: 2 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  141919 http://www.marinespecies.org/aphia.php?p=taxdetails&id=141919
+#> 2  141936 http://www.marinespecies.org/aphia.php?p=taxdetails&id=141936
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <lgl>, isFreshwater <lgl>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr>
+```
+
+using the TAXMATCH algorithm
+
+
+```r
+wm_records_taxamatch(name = 'Platanista gangetica')
+#> [[1]]
+#> # A tibble: 1 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <lgl>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr>
+```
+
+
+## Meta
+
+* Please [report any issues or bugs](https://github.com/ropensci/worrms/issues).
+* License: MIT
+* Get citation information for `worrms` in R doing `citation(package = 'worrms')`
+* Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md).
+By participating in this project you agree to abide by its terms.
+
+[![ropensci_footer](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)
diff --git a/build/vignette.rds b/build/vignette.rds
new file mode 100644
index 0000000..e405151
Binary files /dev/null and b/build/vignette.rds differ
diff --git a/debian/README.test b/debian/README.test
deleted file mode 100644
index 90657cf..0000000
--- a/debian/README.test
+++ /dev/null
@@ -1,8 +0,0 @@
-Notes on how this package can be tested.
-────────────────────────────────────────
-
-This package can be tested by running the provided test:
-
-    sh run-unit-test
-
-in order to confirm its integrity.
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index b95f0d0..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-r-cran-worrms (0.1.0-1) unstable; urgency=medium
-
-  * Initial release (closes: #851958)
-
- -- Andreas Tille <tille at debian.org>  Fri, 20 Jan 2017 12:42:46 +0100
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index f599e28..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/debian/control b/debian/control
deleted file mode 100644
index b1cd110..0000000
--- a/debian/control
+++ /dev/null
@@ -1,30 +0,0 @@
-Source: r-cran-worrms
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
-Section: gnu-r
-Priority: optional
-Build-Depends: debhelper (>= 10),
-               dh-r,
-               r-base-dev,
-               r-cran-tibble,
-               r-cran-jsonlite (>= 1.1),
-               r-cran-crul
-Standards-Version: 3.9.8
-Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/R/r-cran-worrms/trunk/
-Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/R/r-cran-worrms/trunk/
-Homepage: https://cran.r-project.org/package=worrms
-
-Package: r-cran-worrms
-Architecture: all
-Depends: ${R:Depends},
-         ${shlibs:Depends},
-         ${misc:Depends}
-Recommends: ${R:Recommends}
-Suggests: ${R:Suggests}
-Description: GNU R client of World Register of Marine Species (WoRMS)
- Client for World Register of Marine Species
- (<http://www.marinespecies.org/>). Includes functions for each
- of the API methods, including searching for names by name, date and
- common names, searching using external identifiers, fetching
- synonyms, as well as fetching taxonomic children and
- taxonomic classification.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index fc74d0b..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,32 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: worrms
-Upstream-Contact: Scott Chamberlain <myrmecocystus at gmail.com>
-Source: https://cran.r-project.org/package=worrms
-
-Files: *
-Copyright: 2015-2017 Scott Chamberlain
-License: MIT
-
-Files: debian/*
-Copyright: 2017 Andreas Tille <tille at debian.org>
-License: MIT
-
-License: MIT
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
- .
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
- .
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index 6466d39..0000000
--- a/debian/docs
+++ /dev/null
@@ -1,3 +0,0 @@
-debian/tests/run-unit-test
-debian/README.test
-tests
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 529c38a..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@ --buildsystem R
-
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
deleted file mode 100644
index a62fb6e..0000000
--- a/debian/tests/control
+++ /dev/null
@@ -1,5 +0,0 @@
-Tests: run-unit-test
-Depends: @, r-cran-testthat,
-Restrictions: allow-stderr
-
-
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
deleted file mode 100644
index 19ee4de..0000000
--- a/debian/tests/run-unit-test
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh -e
-
-pkgname=worrms
-debname=r-cran-worrms
-
-if [ "$ADTTMP" = "" ] ; then
-    ADTTMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
-    trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
-fi
-cd $ADTTMP
-cp -a /usr/share/doc/$debname/tests/* $ADTTMP
-gunzip -r *
-for testfile in *.R; do
-    echo "BEGIN TEST $testfile"
-    LC_ALL=C R --no-save < $testfile
-done
-
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 2fb8324..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=4
-https://cran.r-project.org/src/contrib/worrms_([-\d.]*)\.tar\.gz
diff --git a/inst/doc/worrms_vignette.R b/inst/doc/worrms_vignette.R
new file mode 100644
index 0000000..2369401
--- /dev/null
+++ b/inst/doc/worrms_vignette.R
@@ -0,0 +1,55 @@
+## ----echo=FALSE----------------------------------------------------------
+knitr::opts_chunk$set(
+  comment = "#>",
+  collapse = TRUE,
+  warning = FALSE,
+  message = FALSE
+)
+
+## ----eval=FALSE----------------------------------------------------------
+#  install.packages("worrms")
+
+## ----eval=FALSE----------------------------------------------------------
+#  install.packages("devtools")
+#  devtools::install_github("ropensci/worrms")
+
+## ------------------------------------------------------------------------
+library("worrms")
+
+## ------------------------------------------------------------------------
+wm_records_date('2016-12-23T05:59:45+00:00')
+
+## ------------------------------------------------------------------------
+wm_records_name(name = 'Platanista gangetica')
+
+## ------------------------------------------------------------------------
+wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+
+## ------------------------------------------------------------------------
+wm_records_common(name = 'clam')
+
+## ------------------------------------------------------------------------
+wm_records_taxamatch(name = 'Platanista gangetica')
+
+## ------------------------------------------------------------------------
+wm_name2id(name = "Rhincodon")
+
+## ------------------------------------------------------------------------
+wm_id2name(id = 105706)
+
+## ------------------------------------------------------------------------
+wm_external(id = 1080)
+wm_external(id = 105706)
+
+## ------------------------------------------------------------------------
+wm_common_id(id = 156806)
+
+## ------------------------------------------------------------------------
+wm_classification(id = 105706)
+
+## ------------------------------------------------------------------------
+wm_classification(id = 105706)
+
+## ------------------------------------------------------------------------
+wm_synonyms(id = 105706)
+
diff --git a/inst/doc/worrms_vignette.Rmd b/inst/doc/worrms_vignette.Rmd
new file mode 100644
index 0000000..da4906f
--- /dev/null
+++ b/inst/doc/worrms_vignette.Rmd
@@ -0,0 +1,129 @@
+---
+title: "Introduction to the worrms package"
+author: "Scott Chamberlain"
+date: "`r Sys.Date()`"
+output: 
+  html_document:
+    toc: true
+    toc_float: true
+    theme: readable
+vignette: >
+  %\VignetteIndexEntry{Introduction to the worrms package}
+  %\VignetteEngine{knitr::rmarkdown}
+  %\VignetteEncoding{UTF-8}
+---
+
+```{r echo=FALSE}
+knitr::opts_chunk$set(
+  comment = "#>",
+  collapse = TRUE,
+  warning = FALSE,
+  message = FALSE
+)
+```
+
+worrms introduction
+===================
+
+`worrms` is an R client for the [World Register of Marine Species](http://www.marinespecies.org/).
+
+## Install
+
+Stable version from CRAN
+
+```{r eval=FALSE}
+install.packages("worrms")
+```
+
+Development version from GitHub
+
+```{r eval=FALSE}
+install.packages("devtools")
+devtools::install_github("ropensci/worrms")
+```
+
+```{r}
+library("worrms")
+```
+
+## Get records
+
+WoRMS 'records' are taxa, not specimen occurrences or something else.
+
+by date
+
+```{r}
+wm_records_date('2016-12-23T05:59:45+00:00')
+```
+
+by a taxonomic name
+
+```{r}
+wm_records_name(name = 'Platanista gangetica')
+```
+
+by many names
+
+```{r}
+wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+```
+
+by common name
+
+```{r}
+wm_records_common(name = 'clam')
+```
+
+using the TAXMATCH algorithm
+
+```{r}
+wm_records_taxamatch(name = 'Platanista gangetica')
+```
+
+## APHIA ID <--> name
+
+```{r}
+wm_name2id(name = "Rhincodon")
+```
+
+```{r}
+wm_id2name(id = 105706)
+```
+
+## Get AphiaID via an external ID
+
+```{r}
+wm_external(id = 1080)
+wm_external(id = 105706)
+```
+
+## Get vernacular names from an AphiaID
+
+```{r}
+wm_common_id(id = 156806)
+```
+
+## Children
+
+Get direct taxonomic children for an AphiaID
+
+```{r}
+wm_classification(id = 105706)
+```
+
+## Classification
+
+Get classification for an AphiaID
+
+```{r}
+wm_classification(id = 105706)
+```
+
+## Synonyms
+
+Get synonyms for an AphiaID
+
+```{r}
+wm_synonyms(id = 105706)
+```
+
diff --git a/inst/doc/worrms_vignette.html b/inst/doc/worrms_vignette.html
new file mode 100644
index 0000000..5e1360f
--- /dev/null
+++ b/inst/doc/worrms_vignette.html
@@ -0,0 +1,438 @@
+<!DOCTYPE html>
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+
+<meta charset="utf-8">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="pandoc" />
+
+
+<meta name="author" content="Scott Chamberlain" />
+
+<meta name="date" content="2017-01-13" />
+
+<title>Introduction to the worrms package</title>
+
+<script src="data:application/x-javascript;base64,LyohIGpRdWVyeSB2MS4xMS4zIHwgKGMpIDIwMDUsIDIwMTUgalF1ZXJ5IEZvdW5kYXRpb24sIEluYy4gfCBqcXVlcnkub3JnL2xpY2Vuc2UgKi8KIWZ1bmN0aW9uKGEsYil7Im9iamVjdCI9PXR5cGVvZiBtb2R1bGUmJiJvYmplY3QiPT10eXBlb2YgbW9kdWxlLmV4cG9ydHM/bW9kdWxlLmV4cG9ydHM9YS5kb2N1bWVudD9iKGEsITApOmZ1bmN0aW9uKGEpe2lmKCFhLmRvY3VtZW50KXRocm93IG5ldyBFcnJvcigialF1ZXJ5IHJlcXVpcmVzIGEgd2luZG93IHdpdGggYSBkb2N1bWVudCIpO3JldHVybiBiKGEpfTpiKGEpfSgidW5kZWZpbmVkIiE9dHlwZW9mIHdpbmRvdz93aW5kb3c6dG [...]
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<link href="data:text/css;charset=utf-8,%40font%2Dface%20%7B%0Afont%2Dfamily%3A%20%27Raleway%27%3B%0Afont%2Dstyle%3A%20normal%3B%0Afont%2Dweight%3A%20400%3B%0Asrc%3A%20url%28data%3Aapplication%2Fx%2Dfont%2Dtruetype%3Bbase64%2CAAEAAAARAQAABAAQR1BPUxtH%2B3EAANmkAAAfHEdTVULdHN8hAAD4wAAAAHRPUy8yithpFAAAoKQAAABgY21hcB3C%2FugAAKEEAAACTGN2dCAMEAMqAACrAAAAADBmcGdtQXn%2FlwAAo1AAAAdJZ2FzcAAAABAAANmcAAAACGdseWaq%2Fo41AAABHAAAmeBoZWFk%2B5BgOAAAnNgAAAA2aGhlYQcyA6MAAKCAAAAAJGhtdHjExydIAACdEAAAA3BrZXJu [...]
+<script src="data:application/x-javascript;base64,LyohCiAqIEJvb3RzdHJhcCB2My4zLjUgKGh0dHA6Ly9nZXRib290c3RyYXAuY29tKQogKiBDb3B5cmlnaHQgMjAxMS0yMDE1IFR3aXR0ZXIsIEluYy4KICogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlCiAqLwppZigidW5kZWZpbmVkIj09dHlwZW9mIGpRdWVyeSl0aHJvdyBuZXcgRXJyb3IoIkJvb3RzdHJhcCdzIEphdmFTY3JpcHQgcmVxdWlyZXMgalF1ZXJ5Iik7K2Z1bmN0aW9uKGEpeyJ1c2Ugc3RyaWN0Ijt2YXIgYj1hLmZuLmpxdWVyeS5zcGxpdCgiICIpWzBdLnNwbGl0KCIuIik7aWYoYlswXTwyJiZiWzFdPDl8fDE9PWJbMF0mJjk9PWJbMV0mJmJbMl08MSl0aHJvdy [...]
+<script src="data:application/x-javascript;base64,LyoqCiogQHByZXNlcnZlIEhUTUw1IFNoaXYgMy43LjIgfCBAYWZhcmthcyBAamRhbHRvbiBAam9uX25lYWwgQHJlbSB8IE1JVC9HUEwyIExpY2Vuc2VkCiovCi8vIE9ubHkgcnVuIHRoaXMgY29kZSBpbiBJRSA4CmlmICghIXdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKCJNU0lFIDgiKSkgewohZnVuY3Rpb24oYSxiKXtmdW5jdGlvbiBjKGEsYil7dmFyIGM9YS5jcmVhdGVFbGVtZW50KCJwIiksZD1hLmdldEVsZW1lbnRzQnlUYWdOYW1lKCJoZWFkIilbMF18fGEuZG9jdW1lbnRFbGVtZW50O3JldHVybiBjLmlubmVySFRNTD0ieDxzdHlsZT4iK2IrIjwvc3R5bGU+IixkLm [...]
+<script src="data:application/x-javascript;base64,LyohIFJlc3BvbmQuanMgdjEuNC4yOiBtaW4vbWF4LXdpZHRoIG1lZGlhIHF1ZXJ5IHBvbHlmaWxsICogQ29weXJpZ2h0IDIwMTMgU2NvdHQgSmVobAogKiBMaWNlbnNlZCB1bmRlciBodHRwczovL2dpdGh1Yi5jb20vc2NvdHRqZWhsL1Jlc3BvbmQvYmxvYi9tYXN0ZXIvTElDRU5TRS1NSVQKICogICovCgovLyBPbmx5IHJ1biB0aGlzIGNvZGUgaW4gSUUgOAppZiAoISF3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgiTVNJRSA4IikpIHsKIWZ1bmN0aW9uKGEpeyJ1c2Ugc3RyaWN0IjthLm1hdGNoTWVkaWE9YS5tYXRjaE1lZGlhfHxmdW5jdGlvbihhKXt2YXIgYixjPWEuZG [...]
+<script src="data:application/x-javascript;base64,LyohIGpRdWVyeSBVSSAtIHYxLjExLjQgLSAyMDE2LTAxLTA1CiogaHR0cDovL2pxdWVyeXVpLmNvbQoqIEluY2x1ZGVzOiBjb3JlLmpzLCB3aWRnZXQuanMsIG1vdXNlLmpzLCBwb3NpdGlvbi5qcywgZHJhZ2dhYmxlLmpzLCBkcm9wcGFibGUuanMsIHJlc2l6YWJsZS5qcywgc2VsZWN0YWJsZS5qcywgc29ydGFibGUuanMsIGFjY29yZGlvbi5qcywgYXV0b2NvbXBsZXRlLmpzLCBidXR0b24uanMsIGRpYWxvZy5qcywgbWVudS5qcywgcHJvZ3Jlc3NiYXIuanMsIHNlbGVjdG1lbnUuanMsIHNsaWRlci5qcywgc3Bpbm5lci5qcywgdGFicy5qcywgdG9vbHRpcC5qcywgZWZmZWN0LmpzLC [...]
+<link href="data:text/css;charset=utf-8,%0A%0A%2Etocify%20%7B%0Awidth%3A%2020%25%3B%0Amax%2Dheight%3A%2090%25%3B%0Aoverflow%3A%20auto%3B%0Amargin%2Dleft%3A%202%25%3B%0Aposition%3A%20fixed%3B%0Aborder%3A%201px%20solid%20%23ccc%3B%0Awebkit%2Dborder%2Dradius%3A%206px%3B%0Amoz%2Dborder%2Dradius%3A%206px%3B%0Aborder%2Dradius%3A%206px%3B%0A%7D%0A%0A%2Etocify%20ul%2C%20%2Etocify%20li%20%7B%0Alist%2Dstyle%3A%20none%3B%0Amargin%3A%200%3B%0Apadding%3A%200%3B%0Aborder%3A%20none%3B%0Aline%2Dheight%3 [...]
+<script src="data:application/x-javascript;base64,LyoganF1ZXJ5IFRvY2lmeSAtIHYxLjkuMSAtIDIwMTMtMTAtMjIKICogaHR0cDovL3d3dy5ncmVnZnJhbmtvLmNvbS9qcXVlcnkudG9jaWZ5LmpzLwogKiBDb3B5cmlnaHQgKGMpIDIwMTMgR3JlZyBGcmFua287IExpY2Vuc2VkIE1JVCAqLwoKLy8gSW1tZWRpYXRlbHktSW52b2tlZCBGdW5jdGlvbiBFeHByZXNzaW9uIChJSUZFKSBbQmVuIEFsbWFuIEJsb2cgUG9zdF0oaHR0cDovL2JlbmFsbWFuLmNvbS9uZXdzLzIwMTAvMTEvaW1tZWRpYXRlbHktaW52b2tlZC1mdW5jdGlvbi1leHByZXNzaW9uLykgdGhhdCBjYWxscyBhbm90aGVyIElJRkUgdGhhdCBjb250YWlucyBhbGwgb2YgdG [...]
+<script src="data:application/x-javascript;base64,Cgp3aW5kb3cuYnVpbGRUYWJzZXRzID0gZnVuY3Rpb24odG9jSUQpIHsKCiAgLy8gYnVpbGQgYSB0YWJzZXQgZnJvbSBhIHNlY3Rpb24gZGl2IHdpdGggdGhlIC50YWJzZXQgY2xhc3MKICBmdW5jdGlvbiBidWlsZFRhYnNldCh0YWJzZXQpIHsKCiAgICAvLyBjaGVjayBmb3IgZmFkZSBhbmQgcGlsbHMgb3B0aW9ucwogICAgdmFyIGZhZGUgPSB0YWJzZXQuaGFzQ2xhc3MoInRhYnNldC1mYWRlIik7CiAgICB2YXIgcGlsbHMgPSB0YWJzZXQuaGFzQ2xhc3MoInRhYnNldC1waWxscyIpOwogICAgdmFyIG5hdkNsYXNzID0gcGlsbHMgPyAibmF2LXBpbGxzIiA6ICJuYXYtdGFicyI7CgogIC [...]
+<link href="data:text/css;charset=utf-8,pre%20%2Eoperator%2C%0Apre%20%2Eparen%20%7B%0Acolor%3A%20rgb%28104%2C%20118%2C%20135%29%0A%7D%0Apre%20%2Eliteral%20%7B%0Acolor%3A%20%23990073%0A%7D%0Apre%20%2Enumber%20%7B%0Acolor%3A%20%23099%3B%0A%7D%0Apre%20%2Ecomment%20%7B%0Acolor%3A%20%23998%3B%0Afont%2Dstyle%3A%20italic%0A%7D%0Apre%20%2Ekeyword%20%7B%0Acolor%3A%20%23900%3B%0Afont%2Dweight%3A%20bold%0A%7D%0Apre%20%2Eidentifier%20%7B%0Acolor%3A%20rgb%280%2C%200%2C%200%29%3B%0A%7D%0Apre%20%2Estri [...]
+<script src="data:application/x-javascript;base64,dmFyIGhsanM9bmV3IGZ1bmN0aW9uKCl7ZnVuY3Rpb24gbShwKXtyZXR1cm4gcC5yZXBsYWNlKC8mL2dtLCImYW1wOyIpLnJlcGxhY2UoLzwvZ20sIiZsdDsiKX1mdW5jdGlvbiBmKHIscSxwKXtyZXR1cm4gUmVnRXhwKHEsIm0iKyhyLmNJPyJpIjoiIikrKHA/ImciOiIiKSl9ZnVuY3Rpb24gYihyKXtmb3IodmFyIHA9MDtwPHIuY2hpbGROb2Rlcy5sZW5ndGg7cCsrKXt2YXIgcT1yLmNoaWxkTm9kZXNbcF07aWYocS5ub2RlTmFtZT09IkNPREUiKXtyZXR1cm4gcX1pZighKHEubm9kZVR5cGU9PTMmJnEubm9kZVZhbHVlLm1hdGNoKC9ccysvKSkpe2JyZWFrfX19ZnVuY3Rpb24gaCh0LH [...]
+
+<style type="text/css">code{white-space: pre;}</style>
+<style type="text/css">
+  pre:not([class]) {
+    background-color: white;
+  }
+</style>
+<script type="text/javascript">
+if (window.hljs && document.readyState && document.readyState === "complete") {
+   window.setTimeout(function() {
+      hljs.initHighlighting();
+   }, 0);
+}
+</script>
+
+
+
+<style type="text/css">
+h1 {
+  font-size: 34px;
+}
+h1.title {
+  font-size: 38px;
+}
+h2 {
+  font-size: 30px;
+}
+h3 {
+  font-size: 24px;
+}
+h4 {
+  font-size: 18px;
+}
+h5 {
+  font-size: 16px;
+}
+h6 {
+  font-size: 12px;
+}
+.table th:not([align]) {
+  text-align: left;
+}
+</style>
+
+
+</head>
+
+<body>
+
+<style type="text/css">
+.main-container {
+  max-width: 940px;
+  margin-left: auto;
+  margin-right: auto;
+}
+code {
+  color: inherit;
+  background-color: rgba(0, 0, 0, 0.04);
+}
+img {
+  max-width:100%;
+  height: auto;
+}
+.tabbed-pane {
+  padding-top: 12px;
+}
+button.code-folding-btn:focus {
+  outline: none;
+}
+</style>
+
+
+
+<div class="container-fluid main-container">
+
+<!-- tabsets -->
+<script>
+$(document).ready(function () {
+  window.buildTabsets("TOC");
+});
+</script>
+
+<!-- code folding -->
+
+
+
+
+<script>
+$(document).ready(function ()  {
+
+    // move toc-ignore selectors from section div to header
+    $('div.section.toc-ignore')
+        .removeClass('toc-ignore')
+        .children('h1,h2,h3,h4,h5').addClass('toc-ignore');
+
+    // establish options
+    var options = {
+      selectors: "h1,h2,h3",
+      theme: "bootstrap3",
+      context: '.toc-content',
+      hashGenerator: function (text) {
+        return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
+      },
+      ignoreSelector: ".toc-ignore",
+      scrollTo: 0
+    };
+    options.showAndHide = true;
+    options.smoothScroll = true;
+
+    // tocify
+    var toc = $("#TOC").tocify(options).data("toc-tocify");
+});
+</script>
+
+<style type="text/css">
+
+#TOC {
+  margin: 25px 0px 20px 0px;
+}
+ at media (max-width: 768px) {
+#TOC {
+  position: relative;
+  width: 100%;
+}
+}
+
+
+.toc-content {
+  padding-left: 30px;
+  padding-right: 40px;
+}
+
+div.main-container {
+  max-width: 1200px;
+}
+
+div.tocify {
+  width: 20%;
+  max-width: 260px;
+  max-height: 85%;
+}
+
+ at media (min-width: 768px) and (max-width: 991px) {
+  div.tocify {
+    width: 25%;
+  }
+}
+
+ at media (max-width: 767px) {
+  div.tocify {
+    width: 100%;
+    max-width: none;
+  }
+}
+
+.tocify ul, .tocify li {
+  line-height: 20px;
+}
+
+.tocify-subheader .tocify-item {
+  font-size: 0.90em;
+  padding-left: 25px;
+  text-indent: 0;
+}
+
+.tocify .list-group-item {
+  border-radius: 0px;
+}
+
+
+</style>
+
+<!-- setup 3col/9col grid for toc_float and main content  -->
+<div class="row-fluid">
+<div class="col-xs-12 col-sm-4 col-md-3">
+<div id="TOC" class="tocify">
+</div>
+</div>
+
+<div class="toc-content col-xs-12 col-sm-8 col-md-9">
+
+
+
+
+<div class="fluid-row" id="header">
+
+
+
+<h1 class="title toc-ignore">Introduction to the worrms package</h1>
+<h4 class="author"><em>Scott Chamberlain</em></h4>
+<h4 class="date"><em>2017-01-13</em></h4>
+
+</div>
+
+
+<div id="worrms-introduction" class="section level1">
+<h1>worrms introduction</h1>
+<p><code>worrms</code> is an R client for the <a href="http://www.marinespecies.org/">World Register of Marine Species</a>.</p>
+<div id="install" class="section level2">
+<h2>Install</h2>
+<p>Stable version from CRAN</p>
+<pre class="r"><code>install.packages("worrms")</code></pre>
+<p>Development version from GitHub</p>
+<pre class="r"><code>install.packages("devtools")
+devtools::install_github("ropensci/worrms")</code></pre>
+<pre class="r"><code>library("worrms")</code></pre>
+</div>
+<div id="get-records" class="section level2">
+<h2>Get records</h2>
+<p>WoRMS ‘records’ are taxa, not specimen occurrences or something else.</p>
+<p>by date</p>
+<pre class="r"><code>wm_records_date('2016-12-23T05:59:45+00:00')
+#> # A tibble: 50 × 25
+#>    AphiaID                                                           url
+#> *    <int>                                                         <chr>
+#> 1   894298 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894298
+#> 2   894301 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894301
+#> 3   894297 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894297
+#> 4   894302 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894302
+#> 5   894296 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894296
+#> 6   894299 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894299
+#> 7   894303 http://www.marinespecies.org/aphia.php?p=taxdetails&id=894303
+#> 8   897486 http://www.marinespecies.org/aphia.php?p=taxdetails&id=897486
+#> 9   901957 http://www.marinespecies.org/aphia.php?p=taxdetails&id=901957
+#> 10  899919 http://www.marinespecies.org/aphia.php?p=taxdetails&id=899919
+#> # ... with 40 more rows, and 23 more variables: scientificname <chr>,
+#> #   authority <chr>, status <chr>, unacceptreason <lgl>, rank <chr>,
+#> #   valid_AphiaID <int>, valid_name <chr>, valid_authority <chr>,
+#> #   kingdom <chr>, phylum <chr>, class <chr>, order <chr>, family <chr>,
+#> #   genus <chr>, citation <chr>, lsid <chr>, isMarine <int>,
+#> #   isBrackish <lgl>, isFreshwater <lgl>, isTerrestrial <lgl>,
+#> #   isExtinct <int>, match_type <chr>, modified <chr></code></pre>
+<p>by a taxonomic name</p>
+<pre class="r"><code>wm_records_name(name = 'Platanista gangetica')
+#> # A tibble: 3 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> 2  383571 http://www.marinespecies.org/aphia.php?p=taxdetails&id=383571
+#> 3  254969 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254969
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <int>, isExtinct <lgl>, match_type <chr>, modified <chr></code></pre>
+<p>by many names</p>
+<pre class="r"><code>wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+#> [[1]]
+#> # A tibble: 1 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <lgl>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr>
+#> 
+#> [[2]]
+#> # A tibble: 2 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  125960 http://www.marinespecies.org/aphia.php?p=taxdetails&id=125960
+#> 2  843430                                                          <NA>
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <chr>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <int>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr></code></pre>
+<p>by common name</p>
+<pre class="r"><code>wm_records_common(name = 'clam')
+#> # A tibble: 2 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  141919 http://www.marinespecies.org/aphia.php?p=taxdetails&id=141919
+#> 2  141936 http://www.marinespecies.org/aphia.php?p=taxdetails&id=141936
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <int>, isBrackish <lgl>, isFreshwater <lgl>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr></code></pre>
+<p>using the TAXMATCH algorithm</p>
+<pre class="r"><code>wm_records_taxamatch(name = 'Platanista gangetica')
+#> [[1]]
+#> # A tibble: 1 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  254967 http://www.marinespecies.org/aphia.php?p=taxdetails&id=254967
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <lgl>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <chr>, citation <chr>,
+#> #   lsid <chr>, isMarine <lgl>, isBrackish <lgl>, isFreshwater <int>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr></code></pre>
+</div>
+<div id="aphia-id-name" class="section level2">
+<h2>APHIA ID <–> name</h2>
+<pre class="r"><code>wm_name2id(name = "Rhincodon")
+#> [1] 105749</code></pre>
+<pre class="r"><code>wm_id2name(id = 105706)
+#> [1] "Rhincodontidae"</code></pre>
+</div>
+<div id="get-aphiaid-via-an-external-id" class="section level2">
+<h2>Get AphiaID via an external ID</h2>
+<pre class="r"><code>wm_external(id = 1080)
+#> [1] 85257
+wm_external(id = 105706)
+#> [1] 159854</code></pre>
+</div>
+<div id="get-vernacular-names-from-an-aphiaid" class="section level2">
+<h2>Get vernacular names from an AphiaID</h2>
+<pre class="r"><code>wm_common_id(id = 156806)
+#> # A tibble: 2 × 3
+#>            vernacular language_code language
+#> *               <chr>         <chr>    <chr>
+#> 1    gilded wedgeclam           eng  English
+#> 2 Turton's wedge clam           eng  English</code></pre>
+</div>
+<div id="children" class="section level2">
+<h2>Children</h2>
+<p>Get direct taxonomic children for an AphiaID</p>
+<pre class="r"><code>wm_classification(id = 105706)
+#> # A tibble: 11 × 3
+#>    AphiaID       rank   scientificname
+#> *    <int>      <chr>            <chr>
+#> 1        2    Kingdom         Animalia
+#> 2     1821     Phylum         Chordata
+#> 3   146419  Subphylum       Vertebrata
+#> 4     1828 Superclass    Gnathostomata
+#> 5    11676 Superclass           Pisces
+#> 6    10193      Class   Elasmobranchii
+#> 7   368407   Subclass      Neoselachii
+#> 8   368408 Infraclass         Selachii
+#> 9   368410 Superorder      Galeomorphi
+#> 10   10208      Order Orectolobiformes
+#> 11  105706     Family   Rhincodontidae</code></pre>
+</div>
+<div id="classification" class="section level2">
+<h2>Classification</h2>
+<p>Get classification for an AphiaID</p>
+<pre class="r"><code>wm_classification(id = 105706)
+#> # A tibble: 11 × 3
+#>    AphiaID       rank   scientificname
+#> *    <int>      <chr>            <chr>
+#> 1        2    Kingdom         Animalia
+#> 2     1821     Phylum         Chordata
+#> 3   146419  Subphylum       Vertebrata
+#> 4     1828 Superclass    Gnathostomata
+#> 5    11676 Superclass           Pisces
+#> 6    10193      Class   Elasmobranchii
+#> 7   368407   Subclass      Neoselachii
+#> 8   368408 Infraclass         Selachii
+#> 9   368410 Superorder      Galeomorphi
+#> 10   10208      Order Orectolobiformes
+#> 11  105706     Family   Rhincodontidae</code></pre>
+</div>
+<div id="synonyms" class="section level2">
+<h2>Synonyms</h2>
+<p>Get synonyms for an AphiaID</p>
+<pre class="r"><code>wm_synonyms(id = 105706)
+#> # A tibble: 1 × 25
+#>   AphiaID                                                           url
+#> *   <int>                                                         <chr>
+#> 1  148832 http://www.marinespecies.org/aphia.php?p=taxdetails&id=148832
+#> # ... with 23 more variables: scientificname <chr>, authority <chr>,
+#> #   status <chr>, unacceptreason <chr>, rank <chr>, valid_AphiaID <int>,
+#> #   valid_name <chr>, valid_authority <chr>, kingdom <chr>, phylum <chr>,
+#> #   class <chr>, order <chr>, family <chr>, genus <lgl>, citation <chr>,
+#> #   lsid <chr>, isMarine <lgl>, isBrackish <lgl>, isFreshwater <lgl>,
+#> #   isTerrestrial <lgl>, isExtinct <lgl>, match_type <chr>, modified <chr></code></pre>
+</div>
+</div>
+
+
+
+</div>
+</div>
+
+</div>
+
+<script>
+
+// add bootstrap table styles to pandoc tables
+function bootstrapStylePandocTables() {
+  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');
+}
+$(document).ready(function () {
+  bootstrapStylePandocTables();
+});
+
+
+</script>
+
+<!-- dynamically load mathjax for compatibility with self-contained -->
+<script>
+  (function () {
+    var script = document.createElement("script");
+    script.type = "text/javascript";
+    script.src  = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
+    document.getElementsByTagName("head")[0].appendChild(script);
+  })();
+</script>
+
+</body>
+</html>
diff --git a/man/wm_children.Rd b/man/wm_children.Rd
new file mode 100644
index 0000000..507034e
--- /dev/null
+++ b/man/wm_children.Rd
@@ -0,0 +1,26 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_children.R
+\name{wm_children}
+\alias{wm_children}
+\title{Get children for an AphiaID}
+\usage{
+wm_children(id, marine_only = TRUE, offset = 1, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{marine_only}{(logical) marine only or not. default: \code{TRUE}}
+
+\item{offset}{(integer) record to start at. default: 1}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get children for an AphiaID
+}
+\examples{
+wm_children(id = 105706)
+wm_children(id = 105706, FALSE)
+wm_children(id = 105706, offset = 5)
+}
+
diff --git a/man/wm_classification.Rd b/man/wm_classification.Rd
new file mode 100644
index 0000000..60e6131
--- /dev/null
+++ b/man/wm_classification.Rd
@@ -0,0 +1,21 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_classification.R
+\name{wm_classification}
+\alias{wm_classification}
+\title{Get classification for an AphiaID}
+\usage{
+wm_classification(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get classification for an AphiaID
+}
+\examples{
+wm_classification(id = 105706)
+wm_classification(id = 126436)
+}
+
diff --git a/man/wm_common_id.Rd b/man/wm_common_id.Rd
new file mode 100644
index 0000000..6ff3c79
--- /dev/null
+++ b/man/wm_common_id.Rd
@@ -0,0 +1,22 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_common_id.R
+\name{wm_common_id}
+\alias{wm_common_id}
+\title{Get vernacular names from an AphiaID}
+\usage{
+wm_common_id(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get vernacular names from an AphiaID
+}
+\examples{
+wm_common_id(id = 105706)
+wm_common_id(id = 156806)
+wm_common_id(id = 397065)
+}
+
diff --git a/man/wm_distribution.Rd b/man/wm_distribution.Rd
new file mode 100644
index 0000000..0cb33d8
--- /dev/null
+++ b/man/wm_distribution.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_distribution.R
+\name{wm_distribution}
+\alias{wm_distribution}
+\title{Get distribution data by AphiaID}
+\usage{
+wm_distribution(id, ...)
+}
+\arguments{
+\item{id}{an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get distribution data by AphiaID
+}
+\examples{
+wm_distribution(id = 156806)
+}
+
diff --git a/man/wm_external.Rd b/man/wm_external.Rd
new file mode 100644
index 0000000..f729550
--- /dev/null
+++ b/man/wm_external.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_externalid.R
+\name{wm_external}
+\alias{wm_external}
+\title{Get an external ID via an AphiaID}
+\usage{
+wm_external(id, type = "tsn", ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{type}{(character) the type of external id. one of: tsn, bold,
+dyntaxa, eol, fishbase, iucn, lsid, ncbi, gisd. default: tsn}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get an external ID via an AphiaID
+}
+\examples{
+# by default, get a TSN (an ITIS code)
+wm_external(id = 1080)
+
+# BOLD code
+wm_external(id = 278468, type = "bold")
+
+# NCBI code
+wm_external(id = 278468, type = "ncbi")
+
+# fishbase code
+wm_external(id = 278468, type = "fishbase")
+
+library(crul)
+wm_external(id = 105706, verbose = TRUE)
+}
+
diff --git a/man/wm_id2name.Rd b/man/wm_id2name.Rd
new file mode 100644
index 0000000..b4b4832
--- /dev/null
+++ b/man/wm_id2name.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_id2name.R
+\name{wm_id2name}
+\alias{wm_id2name}
+\title{Get taxonomic name for an AphiaID}
+\usage{
+wm_id2name(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get taxonomic name for an AphiaID
+}
+\examples{
+wm_id2name(id = 105706)
+}
+
diff --git a/man/wm_name2id.Rd b/man/wm_name2id.Rd
new file mode 100644
index 0000000..ff6a0c1
--- /dev/null
+++ b/man/wm_name2id.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_name2id.R
+\name{wm_name2id}
+\alias{wm_name2id}
+\title{Get AphiaID from a taxonomic name}
+\usage{
+wm_name2id(name, ...)
+}
+\arguments{
+\item{name}{(character) a taxon name}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get AphiaID from a taxonomic name
+}
+\examples{
+wm_name2id(name = "Rhincodon")
+}
+
diff --git a/man/wm_record.Rd b/man/wm_record.Rd
new file mode 100644
index 0000000..4e46ac1
--- /dev/null
+++ b/man/wm_record.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_record.R
+\name{wm_record}
+\alias{wm_record}
+\title{Get complete AphiaRecord for an AphiaID}
+\usage{
+wm_record(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get complete AphiaRecord for an AphiaID
+}
+\examples{
+wm_record(id = 105706)
+}
+
diff --git a/man/wm_record_by_external.Rd b/man/wm_record_by_external.Rd
new file mode 100644
index 0000000..ff82ccb
--- /dev/null
+++ b/man/wm_record_by_external.Rd
@@ -0,0 +1,24 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_record_by_external.R
+\name{wm_record_by_external}
+\alias{wm_record_by_external}
+\title{Get record by external ID}
+\usage{
+wm_record_by_external(id, type = "tsn", ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{type}{(character) the type of external id. one of: tsn, bold,
+dyntaxa, eol, fishbase, iucn, lsid, ncbi, gisd. default: tsn}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get record by external ID
+}
+\examples{
+wm_record_by_external(id = 85257)
+wm_record_by_external(id = 159854)
+}
+
diff --git a/man/wm_records_common.Rd b/man/wm_records_common.Rd
new file mode 100644
index 0000000..4a413f4
--- /dev/null
+++ b/man/wm_records_common.Rd
@@ -0,0 +1,30 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_records_common.R
+\name{wm_records_common}
+\alias{wm_records_common}
+\title{Get records by vernacular name, optional fuzzy matching}
+\usage{
+wm_records_common(name, fuzzy = FALSE, offset = 1, ...)
+}
+\arguments{
+\item{name}{(character) a species common name. required.}
+
+\item{fuzzy}{(logical) fuzzy search. default: \code{FALSE}}
+
+\item{offset}{(integer) record to start at. default: 1}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get records by vernacular name, optional fuzzy matching
+}
+\examples{
+wm_records_common(name = 'dolphin')
+wm_records_common(name = 'clam')
+
+\dontrun{
+wm_records_common(name = 'dolphin', fuzzy = TRUE)
+wm_records_common(name = 'clam', fuzzy = TRUE, offset = 5)
+}
+}
+
diff --git a/man/wm_records_date.Rd b/man/wm_records_date.Rd
new file mode 100644
index 0000000..8bf12da
--- /dev/null
+++ b/man/wm_records_date.Rd
@@ -0,0 +1,28 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_records_date.R
+\name{wm_records_date}
+\alias{wm_records_date}
+\title{Get records by date}
+\usage{
+wm_records_date(start_date, end_date = NULL, marine_only = TRUE,
+  offset = 1, ...)
+}
+\arguments{
+\item{start_date}{(character) start date. required.}
+
+\item{end_date}{(character) end date. optional}
+
+\item{marine_only}{(logical) marine only or not. default: \code{TRUE}}
+
+\item{offset}{(integer) record to start at. default: 1}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get records by date
+}
+\examples{
+a_date <- format(Sys.Date() - 1, "\%Y-\%m-\%dT\%H:\%M:\%S+00:00")
+wm_records_date(a_date)
+}
+
diff --git a/man/wm_records_name.Rd b/man/wm_records_name.Rd
new file mode 100644
index 0000000..15011be
--- /dev/null
+++ b/man/wm_records_name.Rd
@@ -0,0 +1,30 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_records_name.R
+\name{wm_records_name}
+\alias{wm_records_name}
+\title{Get records by single name, optional fuzzy matching}
+\usage{
+wm_records_name(name, fuzzy = TRUE, marine_only = TRUE, offset = 1, ...)
+}
+\arguments{
+\item{name}{(character) start date. required.}
+
+\item{fuzzy}{(logical) fuzzy search. default: \code{TRUE}}
+
+\item{marine_only}{(logical) marine only or not. default: \code{TRUE}}
+
+\item{offset}{(integer) record to start at. default: 1}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get records by single name, optional fuzzy matching
+}
+\examples{
+wm_records_name(name = 'Platanista gangetica')
+wm_records_name(name = 'Platanista gangetica', fuzzy = FALSE)
+wm_records_name(name = 'Platanista gangetica', marine_only = FALSE)
+wm_records_name(name = 'Platanista', marine_only = FALSE)
+wm_records_name(name = 'Platanista', marine_only = FALSE, offset = 5)
+}
+
diff --git a/man/wm_records_names.Rd b/man/wm_records_names.Rd
new file mode 100644
index 0000000..ea28084
--- /dev/null
+++ b/man/wm_records_names.Rd
@@ -0,0 +1,26 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_records_names.R
+\name{wm_records_names}
+\alias{wm_records_names}
+\title{Get records for onen or more taxonomic name(s)}
+\usage{
+wm_records_names(name, fuzzy = FALSE, marine_only = TRUE, ...)
+}
+\arguments{
+\item{name}{(character) start date. required.}
+
+\item{fuzzy}{(logical) fuzzy search. default: \code{FALSE}}
+
+\item{marine_only}{(logical) marine only or not. default: \code{TRUE}}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get records for onen or more taxonomic name(s)
+}
+\examples{
+wm_records_names(name = 'Platanista gangetica')
+wm_records_names(name = 'Platanista gangetica', fuzzy = TRUE)
+wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+}
+
diff --git a/man/wm_records_taxamatch.Rd b/man/wm_records_taxamatch.Rd
new file mode 100644
index 0000000..c46a611
--- /dev/null
+++ b/man/wm_records_taxamatch.Rd
@@ -0,0 +1,27 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_records_taxamatch.R
+\name{wm_records_taxamatch}
+\alias{wm_records_taxamatch}
+\title{Get records for onen or more taxonomic name(s) using
+the TAXAMATCH fuzzy matching algorithm}
+\usage{
+wm_records_taxamatch(name, marine_only = TRUE, ...)
+}
+\arguments{
+\item{name}{(character) taxon name. required.}
+
+\item{marine_only}{(logical) marine only or not. default: \code{TRUE}}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get records for onen or more taxonomic name(s) using
+the TAXAMATCH fuzzy matching algorithm
+}
+\examples{
+\dontrun{
+wm_records_taxamatch(name = 'Platanista gangetica')
+wm_records_taxamatch(name = c('Platanista gangetica', 'Coryphaena'))
+}
+}
+
diff --git a/man/wm_sources.Rd b/man/wm_sources.Rd
new file mode 100644
index 0000000..84220a2
--- /dev/null
+++ b/man/wm_sources.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_sources.R
+\name{wm_sources}
+\alias{wm_sources}
+\title{Get sources for an AphiaID}
+\usage{
+wm_sources(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get sources for an AphiaID
+}
+\examples{
+wm_sources(id = 105706)
+}
+
diff --git a/man/wm_synonyms.Rd b/man/wm_synonyms.Rd
new file mode 100644
index 0000000..416a660
--- /dev/null
+++ b/man/wm_synonyms.Rd
@@ -0,0 +1,20 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wm_synonyms.R
+\name{wm_synonyms}
+\alias{wm_synonyms}
+\title{Get synonyms for an AphiaID}
+\usage{
+wm_synonyms(id, ...)
+}
+\arguments{
+\item{id}{(numeric/integer) an AphiaID. required.}
+
+\item{...}{named curl options. see \code{\link[curl]{curl_options}}}
+}
+\description{
+Get synonyms for an AphiaID
+}
+\examples{
+wm_synonyms(id = 105706)
+}
+
diff --git a/man/worrms-package.Rd b/man/worrms-package.Rd
new file mode 100644
index 0000000..0d0db61
--- /dev/null
+++ b/man/worrms-package.Rd
@@ -0,0 +1,25 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/worrms-package.R
+\docType{package}
+\name{worrms-package}
+\alias{worrms}
+\alias{worrms-package}
+\title{World Register of Marine Species Client}
+\description{
+World Register of Marine Species Client
+}
+\section{Fail behavior}{
+
+The WoRMS REST API doesn't have sophisticated error messaging, so
+most errors will result in a \code{(204) - No Content} or
+in \code{(400) - Bad Request}
+
+Because WoRMS doesn't do comprehensive error reporting, we do a fair
+amount of checking user inputs to help prevent errors that will be
+meaningless to the user. Let us know if we can improve on this.
+}
+\author{
+Scott Chamberlain \email{myrmecocystus at gmail.com}
+}
+\keyword{package}
+
diff --git a/tests/test-all.R b/tests/test-all.R
new file mode 100644
index 0000000..b45f698
--- /dev/null
+++ b/tests/test-all.R
@@ -0,0 +1,2 @@
+library("testthat")
+test_check("worrms")
diff --git a/tests/testthat/test-wm_children.R b/tests/testthat/test-wm_children.R
new file mode 100644
index 0000000..44cab60
--- /dev/null
+++ b/tests/testthat/test-wm_children.R
@@ -0,0 +1,41 @@
+context("wm_children")
+
+test_that("wm_children basic usage works", {
+  skip_on_cran()
+
+  aa <- wm_children(id = 105706)
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_gt(NROW(aa), 1)
+
+  expect_equal(unique(aa$family), "Rhincodontidae")
+  expect_equal(unique(aa$order), "Orectolobiformes")
+  expect_equal(unique(aa$class), "Elasmobranchii")
+  expect_equal(unique(aa$phylum), "Chordata")
+  expect_equal(unique(aa$kingdom), "Animalia")
+})
+
+test_that("wm_children - marine_only usage works", {
+  skip_on_cran()
+
+  expect_is(wm_children(id = 105706, FALSE), "tbl_df")
+  expect_is(wm_children(id = 105706, TRUE), "tbl_df")
+})
+
+test_that("wm_children - offset parameter works", {
+  skip_on_cran()
+
+  off1 <- wm_children(id = 105706, offset = 1)
+  off2 <- wm_children(id = 105706, offset = 2)
+
+  expect_equal(off1$AphiaID[1], 297110)
+  expect_equal(off2$AphiaID[1], 398065)
+})
+
+test_that("wm_children fails well", {
+  skip_on_cran()
+
+  expect_error(wm_children(), "argument \"id\" is missing")
+  expect_error(wm_children("asdfafasdfs"), "id must be of class")
+  expect_error(wm_children(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_classification.R b/tests/testthat/test-wm_classification.R
new file mode 100644
index 0000000..4860ca4
--- /dev/null
+++ b/tests/testthat/test-wm_classification.R
@@ -0,0 +1,22 @@
+context("wm_classification")
+
+test_that("wm_classification works", {
+  skip_on_cran()
+
+  aa <- wm_classification(id = 105706)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_named(aa, c('AphiaID', 'rank', 'scientificname'))
+})
+
+test_that("wm_classification fails well", {
+  skip_on_cran()
+
+  expect_error(wm_classification(), "argument \"id\" is missing")
+  expect_error(wm_classification("asdfafasdfs"), "id must be of class")
+
+  bb <- wm_classification(23424234)
+  expect_equal(NROW(bb), 0)
+  expect_equal(length(names(bb)), 0)
+})
diff --git a/tests/testthat/test-wm_common_id.R b/tests/testthat/test-wm_common_id.R
new file mode 100644
index 0000000..a842082
--- /dev/null
+++ b/tests/testthat/test-wm_common_id.R
@@ -0,0 +1,19 @@
+context("wm_common_id")
+
+test_that("wm_common_id basic usage works", {
+  skip_on_cran()
+
+  aa <- wm_common_id(id = 156806)
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_named(aa, c('vernacular', 'language_code', 'language'))
+  expect_match(aa$vernacular, "clam")
+})
+
+test_that("wm_common_id fails well", {
+  skip_on_cran()
+
+  expect_error(wm_common_id(), "argument \"id\" is missing")
+  expect_error(wm_common_id("asdfafasdfs"), "id must be of class")
+  expect_error(wm_common_id(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_distribution.R b/tests/testthat/test-wm_distribution.R
new file mode 100644
index 0000000..3c160bc
--- /dev/null
+++ b/tests/testthat/test-wm_distribution.R
@@ -0,0 +1,18 @@
+context("wm_distribution")
+
+test_that("wm_distribution basic usage works", {
+  skip_on_cran()
+
+  aa <- wm_distribution(id = 156806)
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_gt(NROW(aa), 1)
+})
+
+test_that("wm_distribution fails well", {
+  skip_on_cran()
+
+  expect_error(wm_distribution(), "argument \"id\" is missing")
+  expect_error(wm_distribution("asdfafasdfs"), "id must be of class")
+  expect_error(wm_distribution(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_external.R b/tests/testthat/test-wm_external.R
new file mode 100644
index 0000000..a6ce688
--- /dev/null
+++ b/tests/testthat/test-wm_external.R
@@ -0,0 +1,27 @@
+context("wm_external")
+
+test_that("wm_external - default usage works", {
+  skip_on_cran()
+
+  aa <- wm_external(id = 1080)
+
+  expect_type(aa, "integer")
+  expect_equal(aa, 85257)
+})
+
+test_that("wm_external - type: fishbase", {
+  skip_on_cran()
+
+  aa <- wm_external(id = 278468, type = "fishbase")
+
+  expect_type(aa, "integer")
+  expect_equal(aa, 8399)
+})
+
+test_that("wm_external fails well", {
+  skip_on_cran()
+
+  expect_error(wm_external(), "argument \"id\" is missing")
+  expect_error(wm_external("asdfafasdfs"), "id must be of class")
+  expect_error(wm_external(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_id2name.R b/tests/testthat/test-wm_id2name.R
new file mode 100644
index 0000000..139fa4e
--- /dev/null
+++ b/tests/testthat/test-wm_id2name.R
@@ -0,0 +1,18 @@
+context("wm_id2name")
+
+test_that("wm_id2name - default usage works", {
+  skip_on_cran()
+
+  aa <- wm_id2name(id = 1080)
+
+  expect_type(aa, "character")
+  expect_equal(aa, "Copepoda")
+})
+
+test_that("wm_id2name fails well", {
+  skip_on_cran()
+
+  expect_error(wm_id2name(), "argument \"id\" is missing")
+  expect_error(wm_id2name("asdfafasdfs"), "id must be of class")
+  expect_error(wm_id2name(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_name2id.R b/tests/testthat/test-wm_name2id.R
new file mode 100644
index 0000000..76957bb
--- /dev/null
+++ b/tests/testthat/test-wm_name2id.R
@@ -0,0 +1,18 @@
+context("wm_name2id")
+
+test_that("wm_name2id - default usage works", {
+  skip_on_cran()
+
+  aa <- wm_name2id(name = "Rhincodon")
+
+  expect_type(aa, "integer")
+  expect_equal(aa, 105749)
+})
+
+test_that("wm_name2id fails well", {
+  skip_on_cran()
+
+  expect_error(wm_name2id(), "argument \"name\" is missing")
+  expect_error(wm_name2id(44444), "name must be of class")
+  expect_error(wm_name2id("asdfafasdfs"), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_record.R b/tests/testthat/test-wm_record.R
new file mode 100644
index 0000000..946f14e
--- /dev/null
+++ b/tests/testthat/test-wm_record.R
@@ -0,0 +1,19 @@
+context("wm_record")
+
+test_that("wm_record - default usage works", {
+  skip_on_cran()
+
+  aa <- wm_record(id = 105706)
+
+  expect_type(aa, "list")
+  expect_equal(aa$valid_name, "Rhincodontidae")
+  expect_equal(aa$valid_AphiaID, 105706)
+})
+
+test_that("wm_record fails well", {
+  skip_on_cran()
+
+  expect_error(wm_record(), "argument \"id\" is missing")
+  expect_error(wm_record("asdfafasdfs"), "id must be of class")
+  expect_error(wm_record(44444), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_record_by_external.R b/tests/testthat/test-wm_record_by_external.R
new file mode 100644
index 0000000..2e40186
--- /dev/null
+++ b/tests/testthat/test-wm_record_by_external.R
@@ -0,0 +1,34 @@
+context("wm_record_by_external")
+
+test_that("wm_record_by_external - default - by id type tsn", {
+  skip_on_cran()
+
+  # tsn
+  tsn <- wm_record_by_external(id = 85257)
+  expect_type(tsn, "list")
+  expect_equal(tsn$valid_name, "Copepoda")
+  expect_equal(tsn$valid_AphiaID, 1080)
+
+  # ncbi
+  ncbi <- wm_record_by_external(id = 6830, type = "ncbi")
+  expect_type(ncbi, "list")
+  expect_equal(ncbi$valid_name, "Copepoda")
+  expect_equal(ncbi$valid_AphiaID, 1080)
+
+  # they're equivvalent
+  expect_identical(tsn, ncbi)
+
+  # fishbase
+  fishbase <- wm_record_by_external(id = 8399, type = "fishbase")
+  expect_type(fishbase, "list")
+  expect_equal(fishbase$valid_name, "Callorhinchus callorynchus")
+  expect_equal(fishbase$valid_AphiaID, 278468)
+
+})
+
+test_that("wm_record_by_external fails well", {
+  skip_on_cran()
+
+  expect_error(wm_record_by_external(), "argument \"id\" is missing")
+  expect_error(wm_record_by_external("asdfafasdfs"), "id must be of class")
+})
diff --git a/tests/testthat/test-wm_records_common.R b/tests/testthat/test-wm_records_common.R
new file mode 100644
index 0000000..c52ae22
--- /dev/null
+++ b/tests/testthat/test-wm_records_common.R
@@ -0,0 +1,44 @@
+context("wm_records_common")
+
+test_that("wm_records_common - works", {
+  skip_on_cran()
+
+  aa <- wm_records_common(name = 'dolphin')
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_true(any(grepl("AphiaID", names(aa))))
+  expect_equal(aa$kingdom, "Animalia")
+  expect_equal(aa$genus, "Coryphaena")
+})
+
+test_that("wm_records_common - fuzzy parameter works", {
+  skip_on_cran()
+
+  aa <- wm_records_common(name = 'dolphin')
+  bb <- wm_records_common(name = 'dolphin', fuzzy = TRUE)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_is(bb, "tbl_df")
+  expect_is(bb, "data.frame")
+
+  expect_gt(NROW(bb), NROW(aa))
+})
+
+test_that("wm_records_common - offset parameter works", {
+  skip_on_cran()
+
+  aa <- wm_records_common(name = 'dolphin', fuzzy = TRUE)
+  bb <- wm_records_common(name = 'dolphin', fuzzy = TRUE, offset = 10)
+
+  expect_false(identical(aa$AphiaID, bb$AphiaID))
+})
+
+test_that("wm_records_common fails well", {
+  skip_on_cran()
+
+  expect_error(wm_records_common(), "argument \"name\" is missing")
+  expect_error(wm_records_common(55555), "name must be of class character")
+  expect_error(wm_records_common("asdfafasdfs"), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_records_date.R b/tests/testthat/test-wm_records_date.R
new file mode 100644
index 0000000..6245ad6
--- /dev/null
+++ b/tests/testthat/test-wm_records_date.R
@@ -0,0 +1,19 @@
+context("wm_records_date")
+
+test_that("wm_records_date - works", {
+  skip_on_cran()
+
+  a_date <- format(Sys.Date() - 1, "%Y-%m-%dT%H:%M:%S+00:00")
+  aa <- wm_records_date(a_date)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_true(all(grepl("2017", aa$modified)))
+})
+
+test_that("wm_records_date fails well", {
+  skip_on_cran()
+
+  expect_error(wm_records_date(), "argument \"start_date\" is missing")
+  expect_error(wm_records_date(55555), "start_date must be of class character")
+})
diff --git a/tests/testthat/test-wm_records_name.R b/tests/testthat/test-wm_records_name.R
new file mode 100644
index 0000000..1d09585
--- /dev/null
+++ b/tests/testthat/test-wm_records_name.R
@@ -0,0 +1,33 @@
+context("wm_records_name")
+
+test_that("wm_records_name - works", {
+  skip_on_cran()
+
+  aa <- wm_records_name(name = 'Platanista gangetica')
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_true(all(grepl("Platanista", aa$scientificname)))
+  expect_gt(NROW(aa), 1)
+})
+
+test_that("wm_records_name - fuzzy parameter", {
+  skip_on_cran()
+
+  aa <- wm_records_name(name = 'Platanista gangetica', fuzzy = FALSE)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_true(all(grepl("Platanista", aa$scientificname)))
+  expect_equal(NROW(aa), 1)
+})
+
+test_that("wm_records_name fails well", {
+  skip_on_cran()
+
+  expect_error(wm_records_name(), "argument \"name\" is missing")
+  expect_error(wm_records_name(55555), "name must be of class character")
+  expect_error(wm_records_name("asdfs", "Adf"), "fuzzy must be of class logical")
+  expect_error(wm_records_name("asdfs", marine_only = 5), "marine_only must be of class logical")
+  expect_error(wm_records_name("asdfs", offset = "foobar"), "offset must be of class numeric, integer")
+})
diff --git a/tests/testthat/test-wm_records_names.R b/tests/testthat/test-wm_records_names.R
new file mode 100644
index 0000000..0b7195c
--- /dev/null
+++ b/tests/testthat/test-wm_records_names.R
@@ -0,0 +1,34 @@
+context("wm_records_names")
+
+test_that("wm_records_names - works", {
+  skip_on_cran()
+
+  aa <- wm_records_names(name = 'Platanista gangetica')
+
+  expect_is(aa, "list")
+  expect_is(aa[[1]], "tbl_df")
+  expect_is(aa[[1]], "data.frame")
+  expect_true(all(grepl("Platanista", aa[[1]]$scientificname)))
+  expect_equal(NROW(aa[[1]]), 1)
+})
+
+test_that("wm_records_names - fuzzy parameter", {
+  skip_on_cran()
+
+  aa <- wm_records_names(name = 'Platanista gangetica', fuzzy = TRUE)
+
+  expect_is(aa, "list")
+  expect_is(aa[[1]], "tbl_df")
+  expect_is(aa[[1]], "data.frame")
+  expect_true(all(grepl("Platanista", aa[[1]]$scientificname)))
+  expect_gt(NROW(aa[[1]]), 1)
+})
+
+test_that("wm_records_names fails well", {
+  skip_on_cran()
+
+  expect_error(wm_records_names(), "argument \"name\" is missing")
+  expect_error(wm_records_names(55555), "name must be of class character")
+  expect_error(wm_records_names("asdfs", "Adf"), "fuzzy must be of class logical")
+  expect_error(wm_records_names("asdfs", marine_only = 5), "marine_only must be of class logical")
+})
diff --git a/tests/testthat/test-wm_records_taxamatch.R b/tests/testthat/test-wm_records_taxamatch.R
new file mode 100644
index 0000000..b80d83f
--- /dev/null
+++ b/tests/testthat/test-wm_records_taxamatch.R
@@ -0,0 +1,24 @@
+context("wm_records_taxamatch")
+
+test_that("wm_records_taxamatch basic usage works", {
+  skip_on_cran()
+
+  aa <- wm_records_taxamatch(name = 'Platanista gangetica')
+
+  expect_is(aa, "list")
+  expect_equal(length(aa), 1)
+  expect_is(aa[[1]], "tbl_df")
+  expect_is(aa[[1]], "data.frame")
+  expect_equal(NROW(aa[[1]]), 1)
+})
+
+test_that("wm_records_taxamatch fails well", {
+  skip_on_cran()
+
+  expect_error(wm_records_taxamatch(), "argument \"name\" is missing")
+  expect_error(wm_records_taxamatch("asdfafasdfs"), "No Content")
+  expect_error(wm_records_taxamatch(5),
+               "name must be of class character")
+  expect_error(wm_records_taxamatch('Platanista gangetica', marine_only = 5),
+               "marine_only must be of class logical")
+})
diff --git a/tests/testthat/test-wm_sources.R b/tests/testthat/test-wm_sources.R
new file mode 100644
index 0000000..076ef1e
--- /dev/null
+++ b/tests/testthat/test-wm_sources.R
@@ -0,0 +1,21 @@
+context("wm_sources")
+
+test_that("wm_sources - works", {
+  skip_on_cran()
+
+  aa <- wm_sources(id = 105706)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_true(any(grepl("use", names(aa))))
+  expect_true(any(grepl("reference", names(aa))))
+  expect_true(any(grepl("page", names(aa))))
+  expect_true(any(grepl("url", names(aa))))
+})
+
+test_that("wm_sources fails well", {
+  skip_on_cran()
+
+  expect_error(wm_sources(), "argument \"id\" is missing")
+  expect_error(wm_sources(55555), "\\(204\\) No Content")
+})
diff --git a/tests/testthat/test-wm_synonyms.R b/tests/testthat/test-wm_synonyms.R
new file mode 100644
index 0000000..ca70251
--- /dev/null
+++ b/tests/testthat/test-wm_synonyms.R
@@ -0,0 +1,23 @@
+context("wm_synonyms")
+
+test_that("wm_synonyms - works", {
+  skip_on_cran()
+
+  aa <- wm_synonyms(id = 105706)
+
+  expect_is(aa, "tbl_df")
+  expect_is(aa, "data.frame")
+  expect_equal(NROW(aa), 1)
+  expect_true(any(grepl("scientificname", names(aa))))
+  expect_true(any(grepl("AphiaID", names(aa))))
+  expect_true(any(grepl("valid_AphiaID", names(aa))))
+  expect_true(any(grepl("valid_name", names(aa))))
+  expect_true(any(grepl("valid_authority", names(aa))))
+})
+
+test_that("wm_synonyms fails well", {
+  skip_on_cran()
+
+  expect_error(wm_synonyms(), "argument \"id\" is missing")
+  expect_error(wm_synonyms(55555), "\\(204\\) No Content")
+})
diff --git a/vignettes/worrms_vignette.Rmd b/vignettes/worrms_vignette.Rmd
new file mode 100644
index 0000000..da4906f
--- /dev/null
+++ b/vignettes/worrms_vignette.Rmd
@@ -0,0 +1,129 @@
+---
+title: "Introduction to the worrms package"
+author: "Scott Chamberlain"
+date: "`r Sys.Date()`"
+output: 
+  html_document:
+    toc: true
+    toc_float: true
+    theme: readable
+vignette: >
+  %\VignetteIndexEntry{Introduction to the worrms package}
+  %\VignetteEngine{knitr::rmarkdown}
+  %\VignetteEncoding{UTF-8}
+---
+
+```{r echo=FALSE}
+knitr::opts_chunk$set(
+  comment = "#>",
+  collapse = TRUE,
+  warning = FALSE,
+  message = FALSE
+)
+```
+
+worrms introduction
+===================
+
+`worrms` is an R client for the [World Register of Marine Species](http://www.marinespecies.org/).
+
+## Install
+
+Stable version from CRAN
+
+```{r eval=FALSE}
+install.packages("worrms")
+```
+
+Development version from GitHub
+
+```{r eval=FALSE}
+install.packages("devtools")
+devtools::install_github("ropensci/worrms")
+```
+
+```{r}
+library("worrms")
+```
+
+## Get records
+
+WoRMS 'records' are taxa, not specimen occurrences or something else.
+
+by date
+
+```{r}
+wm_records_date('2016-12-23T05:59:45+00:00')
+```
+
+by a taxonomic name
+
+```{r}
+wm_records_name(name = 'Platanista gangetica')
+```
+
+by many names
+
+```{r}
+wm_records_names(name = c('Platanista gangetica', 'Coryphaena'))
+```
+
+by common name
+
+```{r}
+wm_records_common(name = 'clam')
+```
+
+using the TAXMATCH algorithm
+
+```{r}
+wm_records_taxamatch(name = 'Platanista gangetica')
+```
+
+## APHIA ID <--> name
+
+```{r}
+wm_name2id(name = "Rhincodon")
+```
+
+```{r}
+wm_id2name(id = 105706)
+```
+
+## Get AphiaID via an external ID
+
+```{r}
+wm_external(id = 1080)
+wm_external(id = 105706)
+```
+
+## Get vernacular names from an AphiaID
+
+```{r}
+wm_common_id(id = 156806)
+```
+
+## Children
+
+Get direct taxonomic children for an AphiaID
+
+```{r}
+wm_classification(id = 105706)
+```
+
+## Classification
+
+Get classification for an AphiaID
+
+```{r}
+wm_classification(id = 105706)
+```
+
+## Synonyms
+
+Get synonyms for an AphiaID
+
+```{r}
+wm_synonyms(id = 105706)
+```
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-worrms.git



More information about the debian-med-commit mailing list