Title: | Integrated Taxonomic Information System Client |
---|---|
Description: | An interface to the Integrated Taxonomic Information System ('ITIS') (<https://www.itis.gov>). Includes functions to work with the 'ITIS' REST API methods (<https://www.itis.gov/ws_description.html>), as well as the 'Solr' web service (<https://www.itis.gov/solr_documentation.html>). |
Authors: | Julia Blum [aut, cre] |
Maintainer: | Julia Blum <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-08-22 05:17:53 UTC |
Source: | https://github.com/ropensci/ritis |
Interface to Integrated Taxonomic Information (ITIS)
All functions that start with itis_
work with the ITIS Solr
API described at https://www.itis.gov/solr_documentation.html,
which uses the package solrium, and these functions have you
use the solrium function interfaces, so you can pass on parameters
to the solrium functions - so the solrium docs are important
here.
All other functions work with the ITIS REST API described at https://www.itis.gov/ws_description.html. For these methods, they can grab data in either JSON or XML format. JSON is the default. We parse the JSON to R native format, either data.frame, character string, or list. You can get raw JSON as a character string back, or raw XML as a character string, and then parse yourself with jsonlite or xml2
You'll also be interested in the taxize book https://taxize.dev/
"mononomial": a taxonomic name with one part, e.g, Poa
"binomial": a taxonomic name with two parts, e.g, Poa annua
"trinomial": a taxonomic name with three parts, e.g, Poa annua annua
Scott Chamberlain [email protected]
Get accepted names from tsn
accepted_names(tsn, wt = "json", raw = FALSE, ...)
accepted_names(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
Zero row data.frame if the name is accepted, otherwise a data.frame with information on the currently accepted name
## Not run: # TSN accepted - good name, empty data.frame returned accepted_names(tsn = 208527) # TSN not accepted - input TSN is old name, non-empty data.frame returned accepted_names(tsn = 504239) # raw json accepted_names(tsn = 208527, raw = TRUE) ## End(Not run)
## Not run: # TSN accepted - good name, empty data.frame returned accepted_names(tsn = 208527) # TSN not accepted - input TSN is old name, non-empty data.frame returned accepted_names(tsn = 504239) # raw json accepted_names(tsn = 208527, raw = TRUE) ## End(Not run)
Get any match count.
any_match_count(x, wt = "json", raw = FALSE, ...)
any_match_count(x, wt = "json", raw = FALSE, ...)
x |
text or taxonomic serial number (TSN) (character or numeric) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
An integer containing the number of matches the search will return.
## Not run: any_match_count(x = 202385) any_match_count(x = "dolphin") any_match_count(x = "dolphin", wt = "xml") ## End(Not run)
## Not run: any_match_count(x = 202385) any_match_count(x = "dolphin") any_match_count(x = "dolphin", wt = "xml") ## End(Not run)
Get comment detail from TSN
comment_detail(tsn, wt = "json", raw = FALSE, ...)
comment_detail(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
A data.frame with results.
## Not run: comment_detail(tsn=180543) comment_detail(tsn=180543, wt = "xml") ## End(Not run)
## Not run: comment_detail(tsn=180543) comment_detail(tsn=180543, wt = "xml") ## End(Not run)
Get common names from tsn
common_names(tsn, wt = "json", raw = FALSE, ...)
common_names(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: common_names(tsn=183833) common_names(tsn=183833, wt = "xml") ## End(Not run)
## Not run: common_names(tsn=183833) common_names(tsn=183833, wt = "xml") ## End(Not run)
Get core metadata from tsn
core_metadata(tsn, wt = "json", raw = FALSE, ...)
core_metadata(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: # coverage and currrency data core_metadata(tsn=28727) core_metadata(tsn=28727, wt = "xml") # no coverage or currrency data core_metadata(183671) core_metadata(183671, wt = "xml") ## End(Not run)
## Not run: # coverage and currrency data core_metadata(tsn=28727) core_metadata(tsn=28727, wt = "xml") # no coverage or currrency data core_metadata(183671) core_metadata(183671, wt = "xml") ## End(Not run)
Get coverge from tsn
coverage(tsn, wt = "json", raw = FALSE, ...)
coverage(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: # coverage data coverage(tsn=28727) # no coverage data coverage(526852) coverage(526852, wt = "xml") ## End(Not run)
## Not run: # coverage data coverage(tsn=28727) # no coverage data coverage(526852) coverage(526852, wt = "xml") ## End(Not run)
Get credibility rating from tsn
credibility_rating(tsn, wt = "json", raw = FALSE, ...) credibility_ratings(wt = "json", raw = FALSE, ...)
credibility_rating(tsn, wt = "json", raw = FALSE, ...) credibility_ratings(wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
methods:
credibility_rating: Get credibility rating for a tsn
credibility_ratings: Get possible credibility ratings
a data.frame
## Not run: credibility_rating(tsn = 526852) credibility_rating(526852, wt = "xml") credibility_rating(526852, raw = TRUE) credibility_ratings() credibility_ratings(wt = "xml") credibility_ratings(raw = TRUE) ## End(Not run)
## Not run: credibility_rating(tsn = 526852) credibility_rating(526852, wt = "xml") credibility_rating(526852, raw = TRUE) credibility_ratings() credibility_ratings(wt = "xml") credibility_ratings(raw = TRUE) ## End(Not run)
Get currency from tsn
currency(tsn, wt = "json", raw = FALSE, ...)
currency(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: # currency data currency(tsn=28727) currency(tsn=28727, wt = "xml") # no currency dat currency(526852) currency(526852, raw = TRUE) ## End(Not run)
## Not run: # currency data currency(tsn=28727) currency(tsn=28727, wt = "xml") # no currency dat currency(526852) currency(526852, raw = TRUE) ## End(Not run)
Get date data from tsn
date_data(tsn, wt = "json", raw = FALSE, ...)
date_data(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: date_data(tsn = 180543) date_data(180543, wt = "xml") date_data(180543, wt = "json", raw = TRUE) ## End(Not run)
## Not run: date_data(tsn = 180543) date_data(180543, wt = "xml") date_data(180543, wt = "json", raw = TRUE) ## End(Not run)
Get description of the ITIS service
description(wt = "json", raw = FALSE, ...)
description(wt = "json", raw = FALSE, ...)
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a string, the ITIS web service description
## Not run: description() description(wt = "xml") ## End(Not run)
## Not run: description() description(wt = "xml") ## End(Not run)
Get expert information for the TSN.
experts(tsn, wt = "json", raw = FALSE, ...)
experts(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: experts(tsn = 180544) experts(180544, wt = "xml") experts(180544, raw = TRUE) ## End(Not run)
## Not run: experts(tsn = 180544) experts(180544, wt = "xml") experts(180544, raw = TRUE) ## End(Not run)
Get full record from TSN or lsid
full_record(tsn = NULL, lsid = NULL, wt = "json", raw = FALSE, ...)
full_record(tsn = NULL, lsid = NULL, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
lsid |
lsid for a taxonomic group (character) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: # from tsn full_record(tsn = 50423) full_record(tsn = 202385) full_record(tsn = 183833) full_record(tsn = 183833, wt = "xml") full_record(tsn = 183833, raw = TRUE) # from lsid full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") ## End(Not run)
## Not run: # from tsn full_record(tsn = 50423) full_record(tsn = 202385) full_record(tsn = 183833) full_record(tsn = 183833, wt = "xml") full_record(tsn = 183833, raw = TRUE) # from lsid full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") ## End(Not run)
Get geographic divisions from tsn
geographic_divisions(tsn, wt = "json", raw = FALSE, ...)
geographic_divisions(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: geographic_divisions(tsn = 180543) geographic_divisions(tsn = 180543, wt = "xml") geographic_divisions(tsn = 180543, wt = "json", raw = TRUE) ## End(Not run)
## Not run: geographic_divisions(tsn = 180543) geographic_divisions(tsn = 180543, wt = "xml") geographic_divisions(tsn = 180543, wt = "json", raw = TRUE) ## End(Not run)
Get all possible geographic values
geographic_values(wt = "json", raw = FALSE, ...)
geographic_values(wt = "json", raw = FALSE, ...)
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
character vector of geographic names
## Not run: geographic_values() geographic_values(wt = "xml") geographic_values(wt = "json", raw = TRUE) ## End(Not run)
## Not run: geographic_values() geographic_values(wt = "xml") geographic_values(wt = "json", raw = TRUE) ## End(Not run)
Get global species completeness from tsn
global_species_completeness(tsn, wt = "json", raw = FALSE, ...)
global_species_completeness(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: global_species_completeness(tsn = 180541) global_species_completeness(180541, wt = "xml") global_species_completeness(180541, wt = "json", raw = TRUE) ## End(Not run)
## Not run: global_species_completeness(tsn = 180541) global_species_completeness(180541, wt = "xml") global_species_completeness(180541, wt = "json", raw = TRUE) ## End(Not run)
Get hierarchy down from tsn
hierarchy_down(tsn, wt = "json", raw = FALSE, ...) hierarchy_up(tsn, wt = "json", raw = FALSE, ...) hierarchy_full(tsn, wt = "json", raw = FALSE, ...)
hierarchy_down(tsn, wt = "json", raw = FALSE, ...) hierarchy_up(tsn, wt = "json", raw = FALSE, ...) hierarchy_full(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
Hierarchy methods:
hierarchy_down: Get hierarchy down from tsn
hierarchy_up: Get hierarchy up from tsn
hierarchy_full: Get full hierarchy from tsn
## Not run: ## Full down (class Mammalia) hierarchy_down(tsn=179913) ## Full up (genus Agoseris) hierarchy_up(tsn=36485) ## Full hierarchy ### genus Liatris hierarchy_full(tsn=37906) ### get raw data back hierarchy_full(tsn=37906, raw = TRUE) ### genus Baetis, get xml back hierarchy_full(100800, wt = "xml") ## End(Not run)
## Not run: ## Full down (class Mammalia) hierarchy_down(tsn=179913) ## Full up (genus Agoseris) hierarchy_up(tsn=36485) ## Full hierarchy ### genus Liatris hierarchy_full(tsn=37906) ### get raw data back hierarchy_full(tsn=37906, raw = TRUE) ### genus Baetis, get xml back hierarchy_full(100800, wt = "xml") ## End(Not run)
ITIS Solr facet
itis_facet(..., proxy = NULL, callopts = list())
itis_facet(..., proxy = NULL, callopts = list())
... |
Arguments passed on to the |
proxy |
List of arguments for a proxy connection,
including one or more of: url, port, username, password,
and auth. See |
callopts |
Curl options passed on to crul::HttpClient |
## Not run: itis_facet(q = "rank:Species", rows = 0, facet.field = "kingdom")$facet_fields x <- itis_facet(q = "hierarchySoFar:*$Aves$* AND rank:Species AND usage:valid", facet.pivot = "nameWInd,vernacular", facet.limit = -1, facet.mincount = 1, rows = 0) head(x$facet_pivot$`nameWInd,vernacular`) ## End(Not run)
## Not run: itis_facet(q = "rank:Species", rows = 0, facet.field = "kingdom")$facet_fields x <- itis_facet(q = "hierarchySoFar:*$Aves$* AND rank:Species AND usage:valid", facet.pivot = "nameWInd,vernacular", facet.limit = -1, facet.mincount = 1, rows = 0) head(x$facet_pivot$`nameWInd,vernacular`) ## End(Not run)
ITIS Solr group search
itis_group(..., proxy = NULL, callopts = list())
itis_group(..., proxy = NULL, callopts = list())
... |
Arguments passed on to the |
proxy |
List of arguments for a proxy connection,
including one or more of: url, port, username, password,
and auth. See |
callopts |
Curl options passed on to crul::HttpClient |
## Not run: x <- itis_group(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/", group.field = 'rank', group.limit = 3) head(x) ## End(Not run)
## Not run: x <- itis_group(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/", group.field = 'rank', group.limit = 3) head(x) ## End(Not run)
ITIS Solr highlight
itis_highlight(..., proxy = NULL, callopts = list())
itis_highlight(..., proxy = NULL, callopts = list())
... |
Arguments passed on to the |
proxy |
List of arguments for a proxy connection,
including one or more of: url, port, username, password,
and auth. See |
callopts |
Curl options passed on to crul::HttpClient |
## Not run: itis_highlight(q = "rank:Species", hl.fl = 'rank', rows=10) ## End(Not run)
## Not run: itis_highlight(q = "rank:Species", hl.fl = 'rank', rows=10) ## End(Not run)
ITIS Solr search
itis_search(..., proxy = NULL, callopts = list())
itis_search(..., proxy = NULL, callopts = list())
... |
Arguments passed on to the |
proxy |
List of arguments for a proxy connection,
including one or more of: url, port, username, password,
and auth. See |
callopts |
Curl options passed on to crul::HttpClient |
The syntax for this function can be a bit hard to grasp. See https://itis.gov/solr_examples.html for help on generating the syntax ITIS wants for specific searches.
https://www.itis.gov/solr_documentation.html
## Not run: itis_search(q = "tsn:182662") # get all orders within class Aves (birds) z <- itis_search(q = "rank:Class AND nameWOInd:Aves") hierarchy_down(z$tsn) # get taxa "downstream" from a target taxon ## taxize and taxizedb packages have downstream() fxns, but ## you can do a similar thing here by iteratively drilling down ## the taxonomic hierarchy ## here, we get families within Aves library(data.table) aves <- itis_search(q = "rank:Class AND nameWOInd:Aves") aves_orders <- hierarchy_down(aves$tsn) aves_families <- lapply(aves_orders$tsn, hierarchy_down) rbindlist(aves_families) # the tila operator itis_search(q = "nameWOInd:Liquidamber\\ styraciflua~0.4") # matches only monomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/") # matches only binomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*/") # matches only trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*/") # matches binomials or trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*[ ]{0,1}[A-Za-z0-9]*/") itis_search(q = "nameWOInd:Poa\\ annua") # pagination itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", rows = 2) itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", rows = 200) # select fields to return itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", fl = c('nameWInd', 'tsn')) ## End(Not run)
## Not run: itis_search(q = "tsn:182662") # get all orders within class Aves (birds) z <- itis_search(q = "rank:Class AND nameWOInd:Aves") hierarchy_down(z$tsn) # get taxa "downstream" from a target taxon ## taxize and taxizedb packages have downstream() fxns, but ## you can do a similar thing here by iteratively drilling down ## the taxonomic hierarchy ## here, we get families within Aves library(data.table) aves <- itis_search(q = "rank:Class AND nameWOInd:Aves") aves_orders <- hierarchy_down(aves$tsn) aves_families <- lapply(aves_orders$tsn, hierarchy_down) rbindlist(aves_families) # the tila operator itis_search(q = "nameWOInd:Liquidamber\\ styraciflua~0.4") # matches only monomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/") # matches only binomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*/") # matches only trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*/") # matches binomials or trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{1,1}[A-Za-z0-9]*[ ]{0,1}[A-Za-z0-9]*/") itis_search(q = "nameWOInd:Poa\\ annua") # pagination itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", rows = 2) itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", rows = 200) # select fields to return itis_search(q = "nameWOInd:/[A-Za-z0-9]*[ ]{0,0}*/", fl = c('nameWInd', 'tsn')) ## End(Not run)
Get jurisdictional origin from tsn
jurisdictional_origin(tsn, wt = "json", raw = FALSE, ...) jurisdiction_origin_values(wt = "json", raw = FALSE, ...) jurisdiction_values(wt = "json", raw = FALSE, ...)
jurisdictional_origin(tsn, wt = "json", raw = FALSE, ...) jurisdiction_origin_values(wt = "json", raw = FALSE, ...) jurisdiction_values(wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
Jurisdiction methods:
jurisdictional_origin: Get jurisdictional origin from tsn
jurisdiction_origin_values: Get jurisdiction origin values
jurisdiction_values: Get all possible jurisdiction values
jurisdictional_origin: data.frame
jurisdiction_origin_values: data.frame
jurisdiction_values: character vector
## Not run: jurisdictional_origin(tsn=180543) jurisdictional_origin(tsn=180543, wt = "xml") jurisdiction_origin_values() jurisdiction_values() ## End(Not run)
## Not run: jurisdictional_origin(tsn=180543) jurisdictional_origin(tsn=180543, wt = "xml") jurisdiction_origin_values() jurisdiction_values() ## End(Not run)
Get kingdom names from tsn
kingdom_name(tsn, wt = "json", raw = FALSE, ...) kingdom_names(wt = "json", raw = FALSE, ...)
kingdom_name(tsn, wt = "json", raw = FALSE, ...) kingdom_names(wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
kingdom_name: Get kingdom name for a TSN
kingdom_names: Get all possible kingdom names
## Not run: kingdom_name(202385) kingdom_name(202385, wt = "xml") kingdom_names() ## End(Not run)
## Not run: kingdom_name(202385) kingdom_name(202385, wt = "xml") kingdom_names() ## End(Not run)
Provides the date the ITIS database was last updated
last_change_date(wt = "json", raw = FALSE, ...)
last_change_date(wt = "json", raw = FALSE, ...)
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
character value with a date
## Not run: last_change_date() last_change_date(wt = "xml") ## End(Not run)
## Not run: last_change_date() last_change_date(wt = "xml") ## End(Not run)
Gets the TSN corresponding to the LSID, or an empty result if there is no match.
lsid2tsn(lsid, wt = "json", raw = FALSE, ...)
lsid2tsn(lsid, wt = "json", raw = FALSE, ...)
lsid |
(character) lsid for a taxonomic group. Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726") lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726", wt = "xml") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0", wt = "xml") ## End(Not run)
## Not run: lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726") lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726", wt = "xml") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0", wt = "xml") ## End(Not run)
Returns a list of the other sources used for the TSN.
other_sources(tsn, wt = "json", raw = FALSE, ...)
other_sources(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: # results other_sources(tsn=182662) # no results other_sources(tsn=2085272) # get xml other_sources(tsn=182662, wt = "xml") ## End(Not run)
## Not run: # results other_sources(tsn=182662) # no results other_sources(tsn=2085272) # get xml other_sources(tsn=182662, wt = "xml") ## End(Not run)
Returns the parent TSN for the entered TSN.
parent_tsn(tsn, wt = "json", raw = FALSE, ...)
parent_tsn(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: parent_tsn(tsn = 202385) parent_tsn(tsn = 202385, raw = TRUE) parent_tsn(tsn = 202385, wt = "xml") ## End(Not run)
## Not run: parent_tsn(tsn = 202385) parent_tsn(tsn = 202385, raw = TRUE) parent_tsn(tsn = 202385, wt = "xml") ## End(Not run)
Returns a list of the pulications used for the TSN.
publications(tsn, wt = "json", raw = FALSE, ...)
publications(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: publications(tsn = 70340) publications(tsn = 70340, wt = "xml") publications(tsn = 70340, verbose = TRUE) ## End(Not run)
## Not run: publications(tsn = 70340) publications(tsn = 70340, wt = "xml") publications(tsn = 70340, verbose = TRUE) ## End(Not run)
Returns the kingdom and rank information for the TSN.
rank_name(tsn, wt = "json", raw = FALSE, ...)
rank_name(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame, with rank name and other info
## Not run: rank_name(tsn = 202385) ## End(Not run)
## Not run: rank_name(tsn = 202385) ## End(Not run)
Provides a list of all the unique rank names contained in the database and their kingdom and rank ID values.
rank_names(wt = "json", raw = FALSE, ...)
rank_names(wt = "json", raw = FALSE, ...)
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame, with columns:
kingdomname
rankid
rankname
## Not run: rank_names() ## End(Not run)
## Not run: rank_names() ## End(Not run)
Gets a record from an LSID
record(lsid, wt = "json", raw = FALSE, ...)
record(lsid, wt = "json", raw = FALSE, ...)
lsid |
lsid for a taxonomic group (character). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
Gets the partial ITIS record for the TSN in the LSID, found by comparing the TSN in the search key to the TSN field. Returns an empty result set if there is no match or the TSN is invalid.
a data.frame
## Not run: record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") ## End(Not run)
## Not run: record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") ## End(Not run)
Returns the review year for the TSN.
review_year(tsn, wt = "json", raw = FALSE, ...)
review_year(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: review_year(tsn = 180541) ## End(Not run)
## Not run: review_year(tsn = 180541) ## End(Not run)
Returns the scientific name for the TSN. Also returns the component parts (names and indicators) of the scientific name.
scientific_name(tsn, wt = "json", raw = FALSE, ...)
scientific_name(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: scientific_name(tsn = 531894) ## End(Not run)
## Not run: scientific_name(tsn = 531894) ## End(Not run)
Search for any matched page
search_any_match_paged( x, pagesize = NULL, pagenum = NULL, ascend = NULL, wt = "json", raw = FALSE, ... )
search_any_match_paged( x, pagesize = NULL, pagenum = NULL, ascend = NULL, wt = "json", raw = FALSE, ... )
x |
text or taxonomic serial number (TSN) (character or numeric) |
pagesize |
An integer containing the page size (numeric) |
pagenum |
An integer containing the page number (numeric) |
ascend |
A boolean containing true for ascending sort order or false for descending (logical) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
a data.frame
## Not run: search_any_match_paged(x=202385, pagesize=100, pagenum=1, ascend=FALSE) search_any_match_paged(x="Zy", pagesize=100, pagenum=1, ascend=FALSE) ## End(Not run)
## Not run: search_any_match_paged(x=202385, pagesize=100, pagenum=1, ascend=FALSE) search_any_match_paged(x="Zy", pagesize=100, pagenum=1, ascend=FALSE) ## End(Not run)
Search for any match
search_anymatch(x, wt = "json", raw = FALSE, ...)
search_anymatch(x, wt = "json", raw = FALSE, ...)
x |
text or taxonomic serial number (TSN) (character or numeric) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: search_anymatch(x = 202385) search_anymatch(x = "dolphin") # no results search_anymatch(x = "Pisces") ## End(Not run)
## Not run: search_anymatch(x = 202385) search_anymatch(x = "dolphin") # no results search_anymatch(x = "Pisces") ## End(Not run)
Search for tsn by common name
search_common(x, from = "all", wt = "json", raw = FALSE, ...)
search_common(x, from = "all", wt = "json", raw = FALSE, ...)
x |
text or taxonomic serial number (TSN) (character or numeric) |
from |
(character) One of "all", "begin", or "end". See Details. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
The from
parameter:
all - Search against the searchByCommonName
API route, which
searches entire name string
begin - Search against the searchByCommonNameBeginsWith
API
route, which searches for a match at the beginning of a name string
end - Search against the searchByCommonNameEndsWith
API route,
which searches for a match at the end of a name string
a data.frame
## Not run: search_common("american bullfrog") search_common("ferret-badger") search_common("polar bear") # comparison: all, begin, end search_common("inch") search_common("inch", from = "begin") search_common("inch", from = "end") # end search_common("snake", from = "end") ## End(Not run)
## Not run: search_common("american bullfrog") search_common("ferret-badger") search_common("polar bear") # comparison: all, begin, end search_common("inch") search_common("inch", from = "begin") search_common("inch", from = "end") # end search_common("snake", from = "end") ## End(Not run)
Search by scientific name
search_scientific(x, wt = "json", raw = FALSE, ...)
search_scientific(x, wt = "json", raw = FALSE, ...)
x |
text or taxonomic serial number (TSN) (character or numeric) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: search_scientific("Tardigrada") search_scientific("Quercus douglasii") ## End(Not run)
## Not run: search_scientific("Tardigrada") search_scientific("Quercus douglasii") ## End(Not run)
ITIS provides access to their data via their Solr service described at https://www.itis.gov/solr_documentation.html. This is a powerful interace to ITIS data as you have access to a very flexible query interface.
See solr_fields and https://www.itis.gov/solr_documentation.html for guidance on available fields.
itis_search()
- Search
itis_group()
- Group
itis_highlight()
- Highlight
itis_facet()
- Facet
Each element in the list has a list of length tree, with:
A list of length 36
field: the field name, this is the name you can use in your queries
definition: the definition of the field
example: an example value
https://www.itis.gov/solr_documentation.html
Returns a list of the synonyms (if any) for the TSN.
synonym_names(tsn, wt = "json", raw = FALSE, ...)
synonym_names(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: synonym_names(tsn=183671) # tsn not accepted synonym_names(tsn=526852) # tsn accepted ## End(Not run)
## Not run: synonym_names(tsn=183671) # tsn not accepted synonym_names(tsn=526852) # tsn accepted ## End(Not run)
Returns the author information for the TSN.
taxon_authorship(tsn, wt = "json", raw = FALSE, ...)
taxon_authorship(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: taxon_authorship(tsn = 183671) ## End(Not run)
## Not run: taxon_authorship(tsn = 183671) ## End(Not run)
Get ITIS terms, i.e., tsn's, authors, common names, and scientific names
terms(query, what = "both", wt = "json", raw = FALSE, ...)
terms(query, what = "both", wt = "json", raw = FALSE, ...)
query |
One or more common or scientific names, or partial names |
what |
One of both (search common and scientific names), common (search just common names), or scientific (search just scientific names) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: # Get terms searching both common and scientific names terms(query='bear') # Get terms searching just common names terms(query='tarweed', "common") # Get terms searching just scientific names terms(query='Poa annua', "scientific") # many at once terms(query=c('Poa annua', 'Pinus contorta'), "scientific") ## End(Not run)
## Not run: # Get terms searching both common and scientific names terms(query='bear') # Get terms searching just common names terms(query='tarweed', "common") # Get terms searching just scientific names terms(query='Poa annua', "scientific") # many at once terms(query=c('Poa annua', 'Pinus contorta'), "scientific") ## End(Not run)
Get tsn by vernacular language
tsn_by_vernacular_language(language, wt = "json", raw = FALSE, ...)
tsn_by_vernacular_language(language, wt = "json", raw = FALSE, ...)
language |
A string containing the language. This is a language string, not the international language code (character) |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a data.frame
## Not run: tsn_by_vernacular_language(language = "french") ## End(Not run)
## Not run: tsn_by_vernacular_language(language = "french") ## End(Not run)
Gets the unique LSID for the TSN, or an empty result if there is no match.
tsn2lsid(tsn, wt = "json", raw = FALSE, ...)
tsn2lsid(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a character string, an LSID, or NULL
if nothing found
## Not run: tsn2lsid(tsn = 155166) tsn2lsid(tsn = 333333333) tsn2lsid(155166, raw = TRUE) tsn2lsid(155166, wt = "xml") ## End(Not run)
## Not run: tsn2lsid(tsn = 155166) tsn2lsid(tsn = 333333333) tsn2lsid(155166, raw = TRUE) tsn2lsid(155166, wt = "xml") ## End(Not run)
Returns the unacceptability reason, if any, for the TSN.
unacceptability_reason(tsn, wt = "json", raw = FALSE, ...)
unacceptability_reason(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: unacceptability_reason(tsn = 183671) ## End(Not run)
## Not run: unacceptability_reason(tsn = 183671) ## End(Not run)
Returns the usage information for the TSN.
usage(tsn, wt = "json", raw = FALSE, ...)
usage(tsn, wt = "json", raw = FALSE, ...)
tsn |
TSN for a taxonomic group (numeric). Required. |
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
## Not run: usage(tsn = 526852) usage(tsn = 526852, raw = TRUE) usage(tsn = 526852, wt = "xml") ## End(Not run)
## Not run: usage(tsn = 526852) usage(tsn = 526852, raw = TRUE) usage(tsn = 526852, wt = "xml") ## End(Not run)
Provides a list of the unique languages used in the vernacular table.
vernacular_languages(wt = "json", raw = FALSE, ...)
vernacular_languages(wt = "json", raw = FALSE, ...)
wt |
(character) One of "json" or "xml". Required. |
raw |
(logical) Return raw JSON or XML as character string. Required.
Default: |
... |
curl options passed on to crul::HttpClient |
a character vector of verncular names
## Not run: vernacular_languages() ## End(Not run)
## Not run: vernacular_languages() ## End(Not run)