<<

Package ‘taxize’

February 19, 2013

Description Taxonomic information from around the web.

Title Taxonomic information from around the web.

Version 0.0.5

Date 2013-02-19

License CC0

URL https://ropensci.github.com/taxize_

BugReports https://github.com/ropensci/taxize_/issues

LazyLoad yes

LazyData yes

Depends R (>= 2.15.0)

Imports XML, RCurl (>= 1.6), stringr, plyr, httr (>= 0.2), RJSONIO,foreach, ape, Taxonstand, NCBI2R

Suggests testthat, roxygen2, rjson

Collate ’classification.R’ ’get_tsn.R’ ’gnr_datasources.R’’ubio_namebank.R’ ’gni_search.R’ ’gni_details.R’’iucn_summary.R’ ’get_uid.R’ ’plantminer.R’ ’eol_hierarchy.R’’eol_ping.R’ ’eol_search.R’ ’gnr_resolve.R’ ’phylomatic_tree.R’’get_seqs.R’ ’taxize- package.R’ ’capwords.r’’itis_acceptname.R’ ’itis_phymat_format.R’ ’itis_taxrank.R’’eol_pages.R’ ’tp_acceptednames.R’ ’tp_namedistributions.R’’tp_namereferences.R’ ’tp_summary.R’ ’tp_synonyms.R’ ’zzz.R’’get_genes_avail.R’ ’tpl_search.r’ ’tpl_get.r’’itis_downstream.R’ ’eol_dataobjects.R’ ’col_children.R’’col_classification.R’ ’gisd_isinvasive.R’ ’itis_name.R’’tax_name.R’ ’col_downstream.R’ ’get_genes.R’ ’tnrs_sources.r’’tnrs.R’ ’itis.R’

Author Scott Chamberlain [aut, cre], Eduard Szoecs [aut], Carl Boettiger [aut], Ignasi Bartomeus [aut]

Maintainer Scott Chamberlain

NeedsCompilation no

Repository CRAN

Date/Publication 2013-02-19 21:30:50

1 2 R topics documented:

R topics documented:

taxize-package ...... 4 capwords ...... 5 classification ...... 5 col_children ...... 6 col_classification ...... 7 col_downstream ...... 9 eol_dataobjects ...... 10 eol_hierarchy ...... 11 eol_pages ...... 12 eol_ping ...... 13 eol_search ...... 13 getacceptednamesfromtsn ...... 14 getanymatchcount ...... 15 getcommentdetailfromtsn ...... 15 getcommonnamesfromtsn ...... 16 getcoremetadatafromtsn ...... 17 getcoveragefromtsn ...... 17 getcredibilityratingfromtsn ...... 18 getcredibilityratings ...... 18 getcurrencyfromtsn ...... 19 getdatedatafromtsn ...... 19 getdescription ...... 20 getexpertsfromtsn ...... 20 getfullhierarchyfromtsn ...... 21 getfullrecordfromlsid ...... 22 getfullrecordfromtsn ...... 22 getgeographicdivisionsfromtsn ...... 23 getgeographicvalues ...... 23 getglobalspeciescompletenessfromtsn ...... 24 gethierarchydownfromtsn ...... 24 gethierarchyupfromtsn ...... 25 getitistermsfromcommonname ...... 26 getitistermsfromscientificname ...... 26 getjurisdictionaloriginfromtsn ...... 27 getjurisdictionoriginvalues ...... 27 getjurisdictionvalues ...... 28 getkingdomnamefromtsn ...... 28 getkingdomnames ...... 29 getlastchangedate ...... 29 getlsidfromtsn ...... 30 getothersourcesfromtsn ...... 30 getparenttsnfromtsn ...... 31 getpublicationsfromtsn ...... 31 getranknames ...... 32 getrecordfromlsid ...... 32 getreviewyearfromtsn ...... 33 R topics documented: 3

getscientificnamefromtsn ...... 34 getsynonymnamesfromtsn ...... 34 gettaxonauthorshipfromtsn ...... 35 gettaxonomicranknamefromtsn ...... 36 gettaxonomicusagefromtsn ...... 36 gettsnbyvernacularlanguage ...... 37 gettsnfromlsid ...... 37 getunacceptabilityreasonfromtsn ...... 38 getvernacularlanguages ...... 39 get_genes ...... 39 get_genes_avail ...... 40 get_seqs ...... 41 get_tsn ...... 42 get_uid ...... 43 gisd_isinvasive ...... 44 gni_details ...... 45 gni_search ...... 46 gnr_datasources ...... 47 gnr_resolve ...... 48 itis_acceptname ...... 49 itis_downstream ...... 49 itis_name ...... 50 itis_phymat_format ...... 51 itis_taxrank ...... 51 iucn_summary ...... 52 phylomatic_tree ...... 53 plantminer ...... 54 rank_ref ...... 55 searchbycommonname ...... 55 searchbycommonnamebeginswith ...... 56 searchbycommonnameendswith ...... 56 searchbyscientificname ...... 57 searchforanymatch ...... 58 searchforanymatchpaged ...... 58 tax_name ...... 59 tnrs ...... 60 tnrs_sources ...... 61 tpl_get ...... 62 tpl_search ...... 63 tp_acceptednames ...... 63 tp_namedistributions ...... 64 tp_namereferences ...... 65 tp_summary ...... 66 tp_synonyms ...... 66 ubio_namebank ...... 67

Index 69 4 taxize-package

taxize-package Taxnomic search and phylogeny retrieval.

Description Taxnomic search and phylogeny retrieval.

Details We are developing taxize as a package to allow users to search over many websites for species names (scientific and common) and download up- and downstream taxonomic hierarchical information - and many other things. The functions in the package that hit a specific API have a prefix and suffix separated by an un- derscore. They follow the format of service_whatitdoes. For example, gnr_resolve uses the Global Names Resolver API to resolve species names. General functions in the package that don’t hit a specific API don’t have two words separated by an underscore, e.g., classification. You need API keys for Encyclopedia of Life (EOL), the Universal Biological Indexer and Organizer (uBio), Tropicos, and Plantminer. Currently supported APIs are:

API prefix Encyclopedia of Life (EOL) eol_ Integrated Taxonomic Information Service (ITIS) itis_ Phylomatic phylomatic_ uBio ubio_ Global Names Resolver (from EOL/GBIF) gnr_ Global Names Index (from EOL/GBIF) gni_ IUCN Red List iucn_ Tropicos (from Missouri Botanical Garden) tp_ Plantminer plantminer_ Theplantlist.org tpl_ Catalogue of Life col_ Global Invasive Species Database gisd_

Author(s)

Scott Chamberlain Eduard Szoecs Carl Boettiger capwords 5

capwords Capitalize the first letter of a character string.

Description Capitalize the first letter of a character string.

Usage capwords(s, strict = FALSE, onlyfirst = FALSE)

Arguments s A character string strict Should the algorithm be strict about capitalizing. Defaults to FALSE. onlyfirst Capitalize only first word, lowercase all others. Useful for taxonomic names.

Examples capwords(c("using AIC for model selection")) capwords(c("using AIC for model selection"), strict=TRUE)

classification Get taxonomic hierarchy for a given taxon ID.

Description Get taxonomic hierarchy for a given taxon ID.

Usage classification(x, ID = NULL, ...)

## S3 method for class ’tsn’ classification(x, ...)

## S3 method for class ’uid’ classification(x, ...)

Arguments x IDs from get_tsn() or get_uid(). ID type of identifier, either ’uid’ or ’tsn’ ... Currently not used 6 col_children

Value Classification of taxons in a list of data.frames.

Note If IDs are supplied directly (not from the get_* functions) use the methods classification.ncbi() or classification.tsn() directly. See examples.

Examples ## Not run: classification(get_uid(c("Chironomus riparius", "aaa vva"))) classification(get_tsn(c("Chironomus riparius", "aaa vva"), "sciname"))

# must specify Identifier, when not used with get_*() classification(315576, ID = "uid") classification(180544, "tsn")

## End(Not run)

col_children Search Catalogue of Life for for direct children of a particular taxon.

Description Search Catalogue of Life for for direct children of a particular taxon.

Usage col_children(name = NULL, id = NULL, format = NULL, start = NULL, checklist = NULL, url = "http://www.catalogueoflife.org/col/webservice")

Arguments name The string to search for. Only exact matches found the name given will be re- turned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a character may also be used. The name must be at least 3 characters long, not counting wildcard characters. id The record ID of the specific record to return (only for scientific names of species or infraspecific taxa) format format of the results returned. Valid values are format=xml and format=php; if the format parameter is omitted, the results are returned in the default XML for- mat. If format=php then results are returned as a PHP array in serialized string format, which can be converted back to an array in PHP using the unserialize command col_classification 7

start The first record to return. If omitted, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maxi- mum number of results returned by a single query is 500 for terse queries and 50 for full queries). checklist The year of the checklist to query, if you want a specific year’s checklist instead of the lastest as default (numeric). url The base COL url for the function (should be left to default).

Details You must provide one of name or id. The other parameters (format and start) are optional.

Value A list of data.frame’s.

Examples ## Not run: # A basic example col_children(name="Apis")

# An example where there is no classification col_children(id=11935941)

# Use a specific year’s checklist col_children(name="Apis", checklist="2012") col_children(name="Apis", checklist="2009")

# Pass in many names or many id’s out <- col_children(name=c("Buteo","Apis","Accipiter","asdf"), checklist="2012") out$Apis # get just the output you want ldply(out) # or combine to one data.frame

# or pass many id’s out <- col_children(id=c(2346405,2344165,2346405), checklist="2012") ldply(out) # combine to one data.frame

## End(Not run)

col_classification Search Catalogue of Life for taxonomic classifications.

Description Search Catalogue of Life for taxonomic classifications. 8 col_classification

Usage col_classification(name = NULL, id = NULL, format = NULL, start = NULL, checklist = NULL, url = "http://www.catalogueoflife.org/col/webservice")

Arguments name The string to search for. Only exact matches found the name given will be re- turned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a character may also be used. The name must be at least 3 characters long, not counting wildcard characters. id The record ID of the specific record to return (only for scientific names of species or infraspecific taxa) format format of the results returned. Valid values are format=xml and format=php; if the format parameter is omitted, the results are returned in the default XML for- mat. If format=php then results are returned as a PHP array in serialized string format, which can be converted back to an array in PHP using the unserialize command start The first record to return. If omitted, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maxi- mum number of results returned by a single query is 500 for terse queries and 50 for full queries). checklist The year of the checklist to query, if you want a specific year’s checklist instead of the lastest as default (numeric). url The base COL url for the function (should be left to default).

Details You must provide one of name or id. The other parameters (format and start) are optional.

Value A list of data.frame’s.

Examples ## Not run: # A basic example col_classification(name="Apis")

# An example where there is no classification col_classification(id=11935941)

# Use a specific year’s checklist col_classification(name="Apis", checklist="2012") col_classification(name="Apis", checklist="2009") col_downstream 9

# Pass in many names or many id’s out <- col_classification(name=c("Buteo","Apis","Accipiter","asdf"), checklist="2012") out$Apis # get just the output you want ldply(out) # or combine to one data.frame

## End(Not run)

col_downstream Use Catalogue of Life to get downstream taxa to a given taxonomic level.

Description Use Catalogue of Life to get downstream taxa to a given taxonomic level.

Usage col_downstream(name = NULL, downto, format = NULL, start = NULL, checklist = NULL, url = "http://www.catalogueoflife.org/col/webservice")

Arguments name The string to search for. Only exact matches found the name given will be re- turned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a character may also be used. The name must be at least 3 characters long, not counting wildcard characters. downto The taxonomic level you want to go down to. See examples below. The taxo- nomic level IS case sensitive, and you do have to spell it correctly. See data(rank_ref) for spelling. checklist The year of the checklist to query, if you want a specific year’s checklist instead of the lastest as default (numeric). format The returned format (default = NULL). If NULL xml is used. Currently only xml is supported. start The first record to return (default = NULL). If NULL, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maximum number of results returned by a single query is 500 for terse queries and 50 for full queries). url The base COL url for the function (should be left to default).

Details Provide only names instead of id’s 10 eol_dataobjects

Value A list of data.frame’s.

Examples ## Not run: # Some basic examples col_downstream(name="Apis", downto="Species") col_downstream(name="Bryophyta", downto="Family")

# An example that takes a bit longer col_downstream(name=c("Plantae","Animalia"), downto="Class")

# Using a checklist from a specific year col_downstream(name="Bryophyta", downto="Family", checklist="2009")

## End(Not run)

eol_dataobjects Given the identifier for a data object, return all metadata about the object.

Description Given the identifier for a data object, return all metadata about the object.

Usage eol_dataobjects(id, returntype = "data.frame", url = "http://www.eol.org/api/data_objects/1.0/", usekey = TRUE, key = NULL)

Arguments id The EOL data object identifier (character) usekey use your API key or not (TRUE or FALSE) returntype one of "list" of "data.frame" (character) url The EOL url for the function (should be left to default). key Your EOL API key; loads from .Rprofile.

Details It’s possible to return JSON or XML with the EOL API. However, this function only returns JSON for now.

Value List or dataframe. eol_hierarchy 11

Examples

## Not run: eol_dataobjects(id="d72801627bf4adf1a38d9c5f10cc767f") eol_dataobjects(id="21929584")

## End(Not run)

eol_hierarchy Retrieve all taxonomic hierarchy from given EOL taxonID.

Description

Retrieve all taxonomic hierarchy from given EOL taxonID.

Usage eol_hierarchy(taxonid, common_names = NULL, synonyms = NULL, usekey = FALSE, returntype = "data.frame", url = "http://www.eol.org/api/hierarchy_entries/1.0/", key = NULL)

Arguments

taxonid the EOL page identifier (character) common_names Return common names or not (defaults to returning them, given commonnames=0 if not) synonyms Return synonyms or not (defaults to returning them, given synonyms=0 if not) usekey use your API key or not (TRUE or FALSE) returntype one of "list" of "data.frame" (character) url The EOL url for the function (should be left to default). key Your EOL API key; loads from .Rprofile.

Details

It’s possible to return JSON or XML with the EOL API. However, this function only returns JSON for now.

Value

List or dataframe of XXXX. 12 eol_pages

Examples ## Not run: pageid <- eol_search(’Pomatomus’)$id[1] out <- eol_pages(taxonconceptID=pageid) eol_hierarchy(out[out$nameAccordingTo == "NCBI ", "identifier"]) eol_hierarchy(out[out$nameAccordingTo == "Integrated Taxonomic Information System (ITIS)", "identifier"])

## End(Not run)

eol_pages Search for pages in EOL database using a taxonconceptID.

Description Search for pages in EOL database using a taxonconceptID.

Usage eol_pages(taxonconceptID, usekey = FALSE, returntype = "data.frame", url = "http://eol.org/api/pages/1.0/", key = NULL)

Arguments taxonconceptID The taxonconceptID (numeric), which is also the page number. usekey Use your API key or not (TRUE or FALSE) returntype One of "list" of "data.frame" (character) url The EOL url for the function (should be left to default). key Your EOL API key; loads from .Rprofile, or you can specify the key manually the in the function call.

Details It’s possible to return JSON or XML with the EOL API. However, this function only returns JSON for now.

Value JSON list object, or data.frame.

Examples ## Not run: pageid <- eol_search(’Pomatomus’)$id[1] out <- eol_pages(taxonconceptID=pageid) eol_hierarchy(out[out$nameAccordingTo == "NCBI Taxonomy", "identifier"]) eol_hierarchy(out[out$nameAccordingTo == "Integrated Taxonomic Information System (ITIS)", "identifier"])

## End(Not run) eol_ping 13

eol_ping Ping EOL API to see if it’s working.

Description Ping EOL API to see if it’s working.

Usage eol_ping()

Value XML object message about API status.

Examples ## Not run: eol_ping()

## End(Not run)

eol_search Search for terms in EOL database.

Description Search for terms in EOL database.

Usage eol_search(terms, usekey = TRUE, returntype = "data.frame", url = "http://eol.org/api/search/", key = NULL)

Arguments terms search terms (character) usekey use your API key or not (TRUE or FALSE) returntype one of "list" of "data.frame" (character) url The EOL url for the function (should be left to default). key Your EOL API key; loads from .Rprofile. 14 getacceptednamesfromtsn

Details It’s possible to return JSON or XML with the EOL API. However, this function only returns JSON for now.

Value JSON list object, or data.frame.

Examples ## Not run: eol_search(’Homo’) eol_search(’Salix’) eol_search(terms=’Ursus americanus luteolus’)

## End(Not run)

getacceptednamesfromtsn Get accepted names from tsn

Description Get accepted names from tsn

Usage getacceptednamesfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getacceptednamesfromtsn(’208527’) # TSN accepted - good name getacceptednamesfromtsn(tsn=’504239’) # TSN not accepted - input TSN is old name getacceptednamesfromtsn(’504239’, FALSE) # TSN not accepted - input TSN is old name

## End(Not run) getanymatchcount 15

getanymatchcount Get any match count.

Description Get any match count.

Usage getanymatchcount(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Value An integer containing the number of matches the search will return.

Examples ## Not run: getanymatchcount(202385) getanymatchcount("dolphin")

## End(Not run)

getcommentdetailfromtsn Get comment detail from TSN

Description Get comment detail from TSN

Usage getcommentdetailfromtsn(tsn = NA, ..., curl = getCurlHandle()) 16 getcommonnamesfromtsn

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Value A data.frame with results.

Examples

## Not run: getcommentdetailfromtsn(180543)

## End(Not run)

getcommonnamesfromtsn Get common names from tsn

Description Get common names from tsn

Usage getcommonnamesfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getcommonnamesfromtsn(183833)

## End(Not run) getcoremetadatafromtsn 17

getcoremetadatafromtsn Get core metadata from tsn

Description Get core metadata from tsn

Usage getcoremetadatafromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getcoremetadatafromtsn(tsn = 28727) # coverage and currrency data getcoremetadatafromtsn(tsn = 183671) # no coverage or currrency data

## End(Not run)

getcoveragefromtsn Get coverge from tsn

Description Get coverge from tsn

Usage getcoveragefromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) 18 getcredibilityratings

Examples ## Not run: getcoveragefromtsn(tsn = 28727) # coverage data getcoveragefromtsn(tsn = 526852) # no coverage data

## End(Not run)

getcredibilityratingfromtsn Get credibility rating from tsn

Description Get credibility rating from tsn

Usage getcredibilityratingfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getcredibilityratingfromtsn(tsn = 526852)

## End(Not run)

getcredibilityratings Get possible credibility ratings

Description Get possible credibility ratings

Usage getcredibilityratings() getcurrencyfromtsn 19

Examples

## Not run: getcredibilityratings()

## End(Not run)

getcurrencyfromtsn Get currency from tsn

Description Get currency from tsn

Usage getcurrencyfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getcurrencyfromtsn(tsn = 28727) # currency data getcurrencyfromtsn(tsn = 526852) # no currency dat

## End(Not run)

getdatedatafromtsn Get date data from tsn

Description Get date data from tsn

Usage getdatedatafromtsn(tsn = NA, ..., curl = getCurlHandle()) 20 getexpertsfromtsn

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getdatedatafromtsn(tsn = 180543)

## End(Not run)

getdescription Get description of the ITIS service

Description Get description of the ITIS service

Usage getdescription()

Examples

## Not run: getdescription()

## End(Not run)

getexpertsfromtsn Get expert information for the TSN.

Description Get expert information for the TSN.

Usage getexpertsfromtsn(tsn = NA, ..., curl = getCurlHandle()) getfullhierarchyfromtsn 21

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getexpertsfromtsn(tsn = 180544)

## End(Not run)

getfullhierarchyfromtsn Get full hierarchy from tsn

Description

Get full hierarchy from tsn

Usage getfullhierarchyfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getfullhierarchyfromtsn(tsn = 37906) getfullhierarchyfromtsn(tsn = 100800)

## End(Not run) 22 getfullrecordfromtsn

getfullrecordfromlsid Returns the full ITIS record for the TSN in the LSID, found by compar- ing 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.

Description Returns the full 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.

Usage getfullrecordfromlsid(lsid = NA, ..., curl = getCurlHandle())

Arguments lsid lsid for a taxonomic group (character) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getfullrecordfromlsid(lsid = "urn:lsid:itis.gov:itis_tsn:180543")

## End(Not run)

getfullrecordfromtsn Get full record from TSN.

Description Get full record from TSN.

Usage getfullrecordfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) getgeographicdivisionsfromtsn 23

Examples ## Not run: getfullrecordfromtsn(tsn = 183833)

## End(Not run)

getgeographicdivisionsfromtsn Get geographic divisions from tsn

Description Get geographic divisions from tsn

Usage getgeographicdivisionsfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getgeographicdivisionsfromtsn(tsn = 180543)

## End(Not run)

getgeographicvalues Get all possible geographic values

Description Get all possible geographic values

Usage getgeographicvalues() 24 gethierarchydownfromtsn

Examples ## Not run: getgeographicvalues()

## End(Not run)

getglobalspeciescompletenessfromtsn Get global species completeness from tsn

Description Get global species completeness from tsn

Usage getglobalspeciescompletenessfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getglobalspeciescompletenessfromtsn(tsn = 180541)

## End(Not run)

gethierarchydownfromtsn Get hierarchy down from tsn

Description Get hierarchy down from tsn

Usage gethierarchydownfromtsn(tsn = NA, ..., curl = getCurlHandle()) gethierarchyupfromtsn 25

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: gethierarchydownfromtsn(tsn = 161030)

## End(Not run)

gethierarchyupfromtsn Get hierarchy up from tsn

Description

Get hierarchy up from tsn

Usage

gethierarchyupfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: gethierarchyupfromtsn(tsn = 36485)

## End(Not run) 26 getitistermsfromscientificname

getitistermsfromcommonname Get itis terms from common names

Description Get itis terms from common names

Usage getitistermsfromcommonname(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getitistermsfromcommonname("buya")

## End(Not run)

getitistermsfromscientificname Get itis terms from scientific names

Description Get itis terms from scientific names

Usage getitistermsfromscientificname(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) getjurisdictionaloriginfromtsn 27

Examples ## Not run: getitistermsfromscientificname(srchkey = "ursidae")

## End(Not run)

getjurisdictionaloriginfromtsn Get jurisdictional origin from tsn

Description Get jurisdictional origin from tsn

Usage getjurisdictionaloriginfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getjurisdictionaloriginfromtsn(tsn = 180543)

## End(Not run)

getjurisdictionoriginvalues Get jurisdiction origin values

Description Get jurisdiction origin values

Usage getjurisdictionoriginvalues() 28 getkingdomnamefromtsn

Examples ## Not run: getjurisdictionoriginvalues()

## End(Not run)

getjurisdictionvalues Get possible jurisdiction values

Description Get possible jurisdiction values

Usage getjurisdictionvalues()

Examples ## Not run: getjurisdictionvalues()

## End(Not run)

getkingdomnamefromtsn Get kingdom names from tsn

Description Get kingdom names from tsn

Usage getkingdomnamefromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) getkingdomnames 29

Examples

## Not run: getkingdomnamefromtsn(tsn = 202385)

## End(Not run)

getkingdomnames Get all possible kingdom names

Description Get all possible kingdom names

Usage getkingdomnames()

Examples

## Not run: getkingdomnamefromtsn(tsn = 202385)

## End(Not run)

getlastchangedate Provides the date the ITIS database was last updated.

Description Provides the date the ITIS database was last updated.

Usage getlastchangedate()

Examples

## Not run: getlastchangedate()

## End(Not run) 30 getothersourcesfromtsn

getlsidfromtsn Gets the unique LSID for the TSN, or an empty result if there is no match.

Description Gets the unique LSID for the TSN, or an empty result if there is no match.

Usage getlsidfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getlsidfromtsn(tsn = 155166)

## End(Not run)

getothersourcesfromtsn Returns a list of the other sources used for the TSN.

Description Returns a list of the other sources used for the TSN.

Usage getothersourcesfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) getparenttsnfromtsn 31

Examples ## Not run: getothersourcesfromtsn(tsn = 182662)

## End(Not run)

getparenttsnfromtsn Returns the parent TSN for the entered TSN.

Description Returns the parent TSN for the entered TSN.

Usage getparenttsnfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getparenttsnfromtsn(tsn = 202385)

## End(Not run)

getpublicationsfromtsn Returns a list of the pulications used for the TSN.

Description Returns a list of the pulications used for the TSN.

Usage getpublicationsfromtsn(tsn = NA, ..., curl = getCurlHandle()) 32 getrecordfromlsid

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: getpublicationsfromtsn(tsn = 70340)

## End(Not run)

getranknames Provides a list of all the unique rank names contained in the database and their kingdom and rank ID values.

Description Provides a list of all the unique rank names contained in the database and their kingdom and rank ID values.

Usage getranknames()

Examples ## Not run: getranknames()

## End(Not run)

getrecordfromlsid Gets the partial ITIS record for the TSN in the LSID, found by com- paring 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.

Description 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.

Usage getrecordfromlsid(lsid = NA, ..., curl = getCurlHandle()) getreviewyearfromtsn 33

Arguments

lsid lsid for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getrecordfromlsid(lsid = "urn:lsid:itis.gov:itis_tsn:180543")

## End(Not run)

getreviewyearfromtsn Returns the review year for the TSN.

Description

Returns the review year for the TSN.

Usage

getreviewyearfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getreviewyearfromtsn(tsn = 180541)

## End(Not run) 34 getsynonymnamesfromtsn

getscientificnamefromtsn Returns the scientific name for the TSN. Also returns the component parts (names and indicators) of the scientific name.

Description

Returns the scientific name for the TSN. Also returns the component parts (names and indicators) of the scientific name.

Usage getscientificnamefromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getscientificnamefromtsn(tsn = 531894)

## End(Not run)

getsynonymnamesfromtsn Returns a list of the synonyms (if any) for the TSN.

Description

Returns a list of the synonyms (if any) for the TSN.

Usage getsynonymnamesfromtsn(tsn = NA, ..., curl = getCurlHandle()) gettaxonauthorshipfromtsn 35

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getsynonymnamesfromtsn(tsn = 183671) # tsn not accepted getsynonymnamesfromtsn(tsn = 526852) # tsn accepted

## End(Not run)

gettaxonauthorshipfromtsn Returns the author information for the TSN.

Description

Returns the author information for the TSN.

Usage gettaxonauthorshipfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: gettaxonauthorshipfromtsn(tsn = 183671)

## End(Not run) 36 gettaxonomicusagefromtsn

gettaxonomicranknamefromtsn Returns the kingdom and rank information for the TSN.

Description Returns the kingdom and rank information for the TSN.

Usage gettaxonomicranknamefromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: gettaxonomicranknamefromtsn(tsn = 202385)

## End(Not run)

gettaxonomicusagefromtsn Returns the usage information for the TSN.

Description Returns the usage information for the TSN.

Usage gettaxonomicusagefromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) gettsnbyvernacularlanguage 37

Examples ## Not run: gettaxonomicusagefromtsn(tsn = 526852)

## End(Not run)

gettsnbyvernacularlanguage Retrieve accepted TSN (with accepted name)

Description Retrieve accepted TSN (with accepted name)

Usage gettsnbyvernacularlanguage(language = NA, ..., curl = getCurlHandle())

Arguments language A string containing the language. This is a language string, not the international language code (character) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: gettsnbyvernacularlanguage("french")

## End(Not run)

gettsnfromlsid Gets the TSN corresponding to the LSID, or an empty result if there is no match.

Description Gets the TSN corresponding to the LSID, or an empty result if there is no match.

Usage gettsnfromlsid(lsid = NA, ..., curl = getCurlHandle()) 38 getunacceptabilityreasonfromtsn

Arguments

lsid lsid for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: gettsnfromlsid(lsid = "urn:lsid:itis.gov:itis_tsn:28726") gettsnfromlsid(lsid = "urn:lsid:itis.gov:itis_tsn:0")

## End(Not run)

getunacceptabilityreasonfromtsn Returns the unacceptability reason, if any, for the TSN.

Description

Returns the unacceptability reason, if any, for the TSN.

Usage getunacceptabilityreasonfromtsn(tsn = NA, ..., curl = getCurlHandle())

Arguments

tsn TSN for a taxonomic group (numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: getunacceptabilityreasonfromtsn(tsn = 183671)

## End(Not run) getvernacularlanguages 39

getvernacularlanguages Provides a list of the unique languages used in the vernacular table.

Description Provides a list of the unique languages used in the vernacular table.

Usage getvernacularlanguages()

Examples ## Not run: getvernacularlanguages()

## End(Not run)

get_genes Retrieve gene sequences from NCBI by accession number.

Description Retrieve gene sequences from NCBI by accession number.

Usage get_genes(ids, format = "fasta")

Arguments ids GenBank ids to search for (character). format Return type, e.g., "fasta"

Details Removes predicted sequences so you don’t have to remove them. Predicted sequences are those with accession numbers that have "XM_" or "XR_" prefixes.

Value Data.frame of results.

Author(s) Scott Chamberlain 40 get_genes_avail

Examples

## Not run: # A single gene get_genes(ids="360040093", format="fasta")

# Many genes (with different accession numbers) for the same species get_genes(ids=c("360040093","347448433"), format="fasta")

## End(Not run)

get_genes_avail Retrieve gene sequences available for a species from NCBI.

Description

This function retrieves one sequences for each species, picking the longest available for the given gene.

Usage

get_genes_avail(taxon_name, seqrange, getrelated = FALSE)

Arguments

taxon_name Scientific name to search for (character). seqrange Sequence range, as e.g., "1:1000" (character). getrelated Logical, if TRUE, gets the longest sequences of a species in the same as the one searched for. If FALSE, get’s nothing.

Details

Removes predicted sequences so you don’t have to remove them. Predicted sequences are those with accession numbers that have "XM_" or "XR_" prefixes.

Value

Data.frame of results.

Author(s)

Scott Chamberlain get_seqs 41

Examples ## Not run: # A single species out <- get_genes_avail(taxon_name="Umbra limi", seqrange = "1:2000", getrelated=F) unique(out$genesavail) # get list of genes available, removing non-unique ones out[grep("RAG1", out$genesavail, ignore.case=T),] # does the string ’RAG1’ exist in any of the gene names

# A single species without records in NCBI out <- get_genes_avail(taxon_name="Sequoia wellingtonia", seqrange = "1:2000", getrelated=T)

# Many species, can run in parallel or not using plyr species <- c("Salvelinus alpinus","Ictalurus nebulosus","Carassius auratus") out2 <- llply(species, get_genes_avail, seqrange = "1:2000", getrelated=F) lapply(out2, head) # see heads of all out2df <- ldply(out2) # make data.frame of all unique(out2df$genesavail) # get list of genes available, removing non-unique ones out2df[grep("RAG1", out2df$genesavail, ignore.case=T),] # search across all

## End(Not run)

get_seqs Retrieve nucleotide sequences from NCBI.

Description This function retrieves one sequences for each species, picking the longest available for the given gene.

Usage get_seqs(taxon_name, gene, seqrange, getrelated, writetodf = TRUE, filetowriteto)

Arguments taxon_name Scientific name to search for (character). gene Gene (character) or genes (character vector) to search for. seqrange Sequence range, as e.g., "1:1000" (character). getrelated Logical, if TRUE, gets the longest sequences of a species in the same genus as the one searched for. If FALSE, get’s nothing. writetodf Write resulting data.frame of results to a file on your machine (logical). filetowriteto If writetodf=TRUE, then specify the file name. Default=T.

Details Removes predicted sequences so you don’t have to remove them. Predicted sequences are those with accession numbers that have "XM_" or "XR_" prefixes. 42 get_tsn

Value

Data.frame of results.

Author(s)

Scott Chamberlain

Examples

## Not run: # A single species get_seqs(taxon_name="Acipenser brevirostrum", gene = c("coi", "co1"), seqrange = "1:3000", getrelated=T, writetodf=F)

# Many species, can run in parallel or not using plyr species <- c("Colletes similis","Halictus ligatus","Perdita trisignata") llply(species, get_seqs, gene = c("coi", "co1"), seqrange = "1:2000", getrelated=T, writetodf=F)

## End(Not run)

get_tsn Get the TSN code for a search term.

Description

get_tsn uses a variety of functions from the itis function.

Usage

get_tsn(searchterm, searchtype = "sciname", verbose = TRUE)

Arguments

searchterm A vector of common or scientific names. searchtype One of ’sciname’, ’anymatch’, ’comnamebeg’, ’comname’, ’comnameend’. verbose should progress be printed?

Value

A vector of taxonomic serial numbers (TSN). If a species is not found NA. If more than one TSN is found the function asks for user input. See functions in the itis function. get_uid 43

Examples

## Not run: get_tsn(searchterm="Quercus douglasii", searchtype="sciname") get_tsn(searchterm="Chironomus riparius", searchtype="sciname") get_tsn(c("Chironomus riparius","Quercus douglasii"), "sciname") splist <- c("annona cherimola", ’annona muricata’, "quercus robur", "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus") get_tsn(splist,"sciname")

## End(Not run)

get_uid Get the UID codes from NCBI for species names.

Description

A function to retrieve the UID-Code (Unique Identifier) of a species from NCBI taxonomy browser.

Usage get_uid(sciname, verbose = TRUE)

Arguments

sciname character; scientific name. verbose logical; If TRUE the actual taxon queried is printed on the console.

Value

UID for the supplied species names. NA for non-matching names.

Author(s)

Eduard Szoecs

Examples

## Not run: get_uid(c("Chironomus riparius", "Chaetopteryx")) get_uid(c("Chironomus riparius", "aaa vva"))

## End(Not run) 44 gisd_isinvasive

gisd_isinvasive Check invasive species status for a set of species from GISD database

Description This function check which species (both and animals) are considered "invaders" somewhere in the world. For that end, it checks GISD (http://www.issg.org/database/welcome/) and returns a value, either "Not in GISD" or the brief description presented in GISD. Note that the webpage contains more information. Also note that the function won’t tell you if it’s exotic in your area, a lot of exotic species are not considered invaders (yet). As expected, the function is as good as the database is, which I find quite reliable and well main- tained. The database is also able to recognize a lot (but not all) of the species synonyms.

Usage gisd_isinvasive(x, simplify = FALSE)

Arguments x character; a vector of scientific species names in the form of c("Genus species"). simplify logical; returns a data.frame with the species name and the values "Invasive", "Not in GISD". I recomend to check first the not simplified version (default), which contains raw information about the level of invasiveness.

Value A data.frame with species names and invasiveness.

Author(s) Ignasi Bartomeus

Examples

## Not run: sp <- c("Carpobrotus edulis", "Rosmarinus officinalis") ## first species is invasive, second one is not. gisd_isinvasive(sp) gisd_isinvasive(sp, simplify = TRUE)

## End(Not run) gni_details 45

gni_details Search for taxonomic name details using the Global Names Index.

Description

Uses the Global Names Index, see http://gni.globalnames.org/ for information.

Usage

gni_details(id = NULL, all_records = NULL, url = "http://gni.globalnames.org/name_strings/")

Arguments

id Name id. all_records If all_records is 1, GNI returns all records from all repositories for the name string (takes 0, or 1, default is 1). url Base url for the API; leave as is.

Value

Data.frame of results.

Author(s)

Scott Chamberlain [email protected]

See Also

gnr_datasources, gni_search.

Examples

## Not run: gni_details(id = 17802847) ldply(list(1265133, 17802847), gni_details)

## End(Not run) 46 gni_search

gni_search Search for taxonomic names using the Global Names Index.

Description

Uses the Global Names Index, see http://gni.globalnames.org/ for information.

Usage

gni_search(search_term = NULL, per_page = NULL, page = NULL, justtotal = FALSE, url = "http://gni.globalnames.org/name_strings.json")

Arguments

search_term Name pattern you want to search for search term may include following options (Note: can, uni, gen, sp, ssp, au, yr work only for parsed names): *: wild card Search by part of a word planta* exact: exact match Search for exact match of a literal string exact:Parus major ns: name string Search for literal string from its beginning (other modifiers will be ignored) ns:parus maj* can: canonical form Search name without authors (other modifiers will be ignored) can:parus major uni: uninomial Search for higher taxa uni:parus gen: genus Search by genus epithet of species name gen:parus sp: species Search by species epithet sp:major ssp: subspecies Search by infraspecies epithet ssp:major au: author Search by author word au:Shipunov yr: year Search by year yr:2005 per_page Number of items per one page (numbers larger than 1000 will be decreased to 1000) (default is 30). page Page number you want to see (default is 1). justtotal Return only the total results found. url Base url for the API; leave as is.

Value

Data.frame of results.

Author(s)

Scott Chamberlain [email protected]

See Also

gnr_datasources, gni_search. gnr_datasources 47

Examples ## Not run: gni_search(search_term = "ani*") gni_search(search_term = "ama*", per_page = 3, page = 21) gni_search(search_term = "animalia", per_page = 8, page = 1) gni_search(search_term = "animalia", per_page = 8, page = 1, justtotal=T)

## End(Not run)

gnr_datasources Get data sources for the Global Names Resolver.

Description Uses the Global Names Index, see http://gni.globalnames.org/ for information.

Usage gnr_datasources(todf = FALSE, url = "http://resolver.globalnames.org/data_sources.json")

Arguments todf Parse id and name of provider to data.frame? logical (default = FALSE). url Base url for the API; leave as is.

Value json or xml output, your choice

Author(s) Scott Chamberlain [email protected]

Examples ## Not run: # all data sources gnr_datasources()

# just id’s and names of sources gnr_datasources(todf=T)

# give me the id for EOL out <- gnr_datasources(todf=T) out[out$title == "EOL", "id"]

# Fuzzy search for sources with the word zoo out <- gnr_datasources(todf=T) 48 gnr_resolve

out[agrep("zoo", out$title, ignore.case=T), ]

## End(Not run)

gnr_resolve Resolve names using Global Names Resolver.

Description Uses the Global Names Index, see http://gni.globalnames.org/ for information.

Usage gnr_resolve(names, data_source_ids = NULL, returndf = FALSE, url = "http://resolver.globalnames.org/name_resolvers")

Arguments names Quoted taxonomic names to be resolved in a vector. data_source_ids Supply data source IDs to specify what data source is searched. See example below. returndf Return data.frame or list (logical; default data.frame). url Base url for the API; leave as is.

Value json or xml output, your choice

Author(s) Scott Chamberlain [email protected]

Examples ## Not run: gnr_resolve(names = c("Helianthus annuus", "Homo sapiens"), returndf = TRUE) gnr_resolve(names = c("", "Plantae"), returndf = TRUE)

# Using data source 12 (Encyclopedia of Life) gnr_resolve(names = c("Helianthus annuus", "Homo sapiens"), data_source_ids="12", returndf = TRUE)

## End(Not run) itis_acceptname 49

itis_acceptname Retrieve accepted TSN (with accepted name).

Description

Retrieve accepted TSN (with accepted name).

Usage itis_acceptname(searchtsn = NA)

Arguments

searchtsn Quoted TSN for a taxonomic group (character).

Details

You can print informative messages by setting supmess=FALSE.

Value

Names or TSNs of all downstream taxa.

Examples

## Not run: itis_acceptname(searchtsn=’208527’) # TSN accepted - good name itis_acceptname(searchtsn=’504239’) # TSN not accepted - input TSN is old name

## End(Not run)

itis_downstream Retrieve all taxa names or TSNs downstream in hierarchy from given TSN.

Description

Retrieve all taxa names or TSNs downstream in hierarchy from given TSN.

Usage itis_downstream(tsns, downto) 50 itis_name

Arguments tsns A taxonomic serial number. downto The taxonomic level you want to go down to. See examples below. The taxo- nomic level IS case sensitive, and you do have to spell it correctly. See data(rank_ref) for spelling.

Value Data.frame of taxonomic information downstream to family from e.g., Order, Class, etc.

Author(s) Scott Chamberlain

Examples ## Not run: itis_downstream(tsns=846509, downto="Genus") itis_downstream(tsns = 650497, "Family") # getting families downstream from Acridoidea itis_downstream(tsns = 180541, "Species") # getting species downstream from Ursus

## End(Not run)

itis_name Get taxonomic names for a given taxonomic name query.

Description Get taxonomic names for a given taxonomic name query.

Usage itis_name(query = NULL, get = NULL)

Arguments query TSN number (taxonomic serial number). get The rank of the taxonomic name to get.

Value Taxonomic name for the searched taxon.

Examples ## Not run: itis_name(query="Helianthus annuus", get="family")

## End(Not run) itis_phymat_format 51

itis_phymat_format Get family names to make Phylomatic input object, and output input string to Phylomatic for use in the function phylomatic_tree.

Description Get family names to make Phylomatic input object, and output input string to Phylomatic for use in the function phylomatic_tree.

Usage itis_phymat_format(taxa = NA, format = "isubmit", db = "ncbi")

Arguments taxa quoted tsn number (taxonomic serial number) format output format, isubmit (you can paste in to the Phylomatic website), or ’rsubmit’ to use in fxn phylomatic_tree db One of ncbi or itis

Value e.g., "pinaceae/pinus/pinus_contorta", in Phylomatic submission format.

Examples ## Not run: laply(c("Poa annua", "Abies procera", "Helianthus annuus"), itis_phymat_format, format=’rsubmit’)

## End(Not run)

itis_taxrank Retrieve taxonomic rank name from given TSN.

Description Retrieve taxonomic rank name from given TSN.

Usage itis_taxrank(query = NULL)

Arguments query Quoted TSN for a taxonomic group (numeric), or scientific name (character). 52 iucn_summary

Details

You can print informative messages by setting supmess=FALSE.

Value

Taxonomic rank name.

Examples

## Not run: itis_taxrank(query=202385)

## End(Not run)

iucn_summary Get a summary from the IUCN Red List.

Description

Get a summary from the IUCN Red List (http://www.iucnredlist.org/).

Usage iucn_summary(sciname)

Arguments

sciname character; Scientific name.

Value

A list (for every species one entry) of lists with the following items:

status Red List Category. history History of status. distr Geographic distribution. pop Population size estimates. trend Trend of population size.

Author(s)

Eduard Szoecs phylomatic_tree 53

Examples ## Not run: ia <- iucn_summary(c("Panthera uncia", "Lynx lynx")) ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa")) # extract status ldply(ia, function(x) x$status) laply(ia, function(x) x$status) ia[[’Lynx lynx’]]$history ia[[’Panthera uncia’]]$distr ia[[1]]$pop ia[[2]]$trend

## End(Not run)

phylomatic_tree Format tree string, submit to Phylomatic, get newick tree.

Description Format tree string, submit to Phylomatic, get newick tree.

Usage phylomatic_tree(taxa, taxnames = TRUE, get = "GET", informat = "newick", method = "phylomatic", storedtree = "R20120829", taxaformat = "slashpath", outformat = "newick", clean = "true", parallel = TRUE)

Arguments taxa Phylomatic format input of taxa names. taxnames If true, we get the family names for you to attach to your species names to send to Phylomatic API. If FALSE, you have to provide the strings in the right format. get ’GET’ or ’POST’ format for submission to the website. informat One of newick, nexml, or cdaordf. If using a stored tree, informat should always be newick. method One of phylomatic or convert storedtree One of R20120829 (Phylomatic tree R20120829 for plants), smith2011 (Smith 2011, plants), or binindaemonds2007 (Bininda-Emonds 2007, mammals). taxaformat Only option is slashpath for now. Leave as is. outformat One of newick, nexml, or fyt. clean Return a clean tree or not. parallel Run in parallel or not. 54 plantminer

Details Use the web interface here http://phylodiversity.net/phylomatic/

Value Newick formatted tree.

Examples

## Not run: # Input taxonomic names taxa <- c("Poa annua", "Abies procera", "Helianthus annuus") tree <- phylomatic_tree(taxa=taxa, get = ’POST’, informat=’newick’, method = "phylomatic", storedtree = "R20120829", taxaformat = "slashpath", outformat = "newick", clean = "true") plot(tree)

# Lots of names taxa <- c("Poa annua", "Abies procera", "Helianthus annuus", " grandiflora", "Ribes latifolium", " manzanita", " glabriflora", "Phlox diffusa", "Datura wrightii", "Nicotiana glauca", "Nicotiana tomentosa", "Mimulus bicolor") tree <- phylomatic_tree(taxa=taxa, get = ’POST’, informat=’newick’, method = "phylomatic", storedtree = "R20120829", taxaformat = "slashpath", outformat = "newick", clean = "true") plot(tree, no.margin=T)

# In parallel with parallel=TRUE speeds up dramatically by doing the gathering of # family names from NCBI in parallel registerDoMC(cores=4) # I have a mac, so using doMC package, use whatever you like phylomatic_tree(taxa=taxa, get = ’POST’, informat=’newick’, method = "phylomatic", storedtree = "R20120829", taxaformat = "slashpath", outformat = "newick", clean = "true", parallel=FALSE)

## End(Not run)

plantminer Search for taxonomy data from Plantminer.com

Description Search for taxonomy data from Plantminer.com

Usage plantminer(plants, key = NULL)

Arguments plants Vector of species names. rank_ref 55

key Your api key for the plantminer.com site. Go to http://www.plantminer.com/ to get your api key. Two options for inputting your key. 1) You can input it manually within the function as the second argument, or 2) you can put the key in your .Rprofile file, which will then be loaded when you start R. See https:// github.com/ropensci/rOpenSci/wiki/Installation-and-use-of-API-keys for help on how to put api keys in your .Rprofile file.

Value data.frame of results.

Examples ## Not run: plants <- c("Myrcia lingua", "Myrcia bella", "Ocotea pulchella", "Miconia", "Coffea arabica var. amarella", "Bleh") plantminer(plants)

## End(Not run)

rank_ref Lookup-table for IDs of taxonomic ranks

Description Lookup-table for IDs of taxonomic ranks

searchbycommonname Search for tsn by common name

Description Search for tsn by common name

Usage searchbycommonname(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) 56 searchbycommonnameendswith

Examples ## Not run: searchbycommonname("american bullfrog") searchbycommonname("ferret-badger") searchbycommonname(srchkey="polar bear")

## End(Not run)

searchbycommonnamebeginswith Search for tsn by common name beginning with

Description Search for tsn by common name beginning with

Usage searchbycommonnamebeginswith(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: searchbycommonnamebeginswith("inch")

## End(Not run)

searchbycommonnameendswith Search for tsn by common name ending with

Description Search for tsn by common name ending with searchbyscientificname 57

Usage searchbycommonnameendswith(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: searchbycommonnameendswith(srchkey="snake")

## End(Not run)

searchbyscientificname Search by scientific name

Description Search by scientific name

Usage searchbyscientificname(srchkey = NA, ..., curl = getCurlHandle())

Arguments srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples ## Not run: searchbyscientificname("Tardigrada") searchbyscientificname("Quercus douglasii")

## End(Not run) 58 searchforanymatchpaged

searchforanymatch Search for any match

Description

Search for any match

Usage

searchforanymatch(srchkey = NA, ..., curl = getCurlHandle())

Arguments

srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: searchforanymatch(srchkey = 202385) searchforanymatch(srchkey = "dolphin")

## End(Not run)

searchforanymatchpaged Search for any matched page

Description

Search for any matched page

Usage

searchforanymatchpaged(srchkey = NA, pagesize = NA, pagenum = NA, ascend = NA, ..., curl = getCurlHandle()) tax_name 59

Arguments

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 (log- ical) srchkey text or taxonomic serial number (TSN) (character or numeric) ... optional additional curl options (debugging tools mostly) curl If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

Examples

## Not run: searchforanymatchpaged(202385, 100, 1, FALSE)

## End(Not run)

tax_name Get taxonomic names for a given taxonomic name query.

Description

Specify what database you want to use: itis or ncbi.

Usage

tax_name(query = NULL, get = NULL, db = "itis", verbose = TRUE)

Arguments

query Taxonomic name (character). get The rank of the taxonomic name to get (character). db The database to search from (character). verbose logical; If TRUE the actual taxon queried is printed on the console.

Value

Taxonomic name for the searched taxon. If the taxon is not found NA is returned. 60 tnrs

Examples ## Not run: # A case where itis and ncbi use the same names tax_name(query="Helianthus annuus", get="family", db="itis") tax_name(query="Helianthus annuus", get="family", db="ncbi")

# Case where itis and ncbi use different names tax_name(query="Helianthus annuus", get="kingdom", db="itis") tax_name(query="Helianthus annuus", get="kingdom", db="ncbi")

## End(Not run)

tnrs Search the Phylotastic Taxonomic Name Resolution Service.

Description Match taxonomic names using the Taxonomic Name Resolution Service (TNRS). Returns score of the matched name, and whether it was accepted or not.

Usage tnrs(query = NA, source_ = NULL, code = NULL, getpost = "GET", sleep = 0, splitby = NULL)

Arguments query Quoted taxonomic names to search in a vector (character). source_ Specify the source you want to match names against. Defaults to just retrieve data from all sources. Options: NCBI, iPlant_TNRS, or MSW3. code Nomenclatural code. One of: ICZN (zoological), ICN (algae, fungi, and plants), ICNB (bacteria), ICBN (botanical), ICNCP (cultivated plants), ICTV (viruses) getpost Use GET or POST method to send the query. If you have more than say 50 species or so in your query, you should probably use POST. sleep Numer of seconds by which to pause between calls. Defaults to 0 seconds. Use when doing many calls in a for loop ar lapply type call. splitby Number by which to split species list for querying the TNRS.

Details If there is no match in the Taxosaurus database, nothing is returned, so you will not get anything back for non matches.

Value data.frame of results from TNRS plus the name submitted. tnrs_sources 61

Examples

## Not run: # Default, uses GET curl method, you can’t specify any other parameters when using GET mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", "Humbert humbert") tnrs(query = mynames)

# Specifying the source to match against mynames <- c("Helianthus annuus", "Poa annua") tnrs(query = mynames, source_ = "iPlant_TNRS")

# Specifying the nomenclatural code to match against mynames <- c("Helianthus annuus", "Poa annua") tnrs(query = mynames, code = "ICBN")

# You can specify multiple sources, by comma-separating them mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", "Humbert humbert") tnrs(query = mynames, source_ = "NCBI,MSW3")

# Using POST method, especially useful when you have a lot of species mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", "Humbert humbert", "Helianthus annuus", "Pinus contorta", "Poa annua", "Abies magnifica", "Rosa ", "Festuca arundinace", "Mimulus bicolor", "Sorbus occidentalis", "", "Thymopsis thymodes", "Bartlettia scaposa") tnrs(mynames, getpost="POST", source_ = "NCBI")

## End(Not run)

tnrs_sources Get sources for the Phylotastic Taxonomic Name Resolution Service.

Description

Get sources for the Phylotastic Taxonomic Name Resolution Service.

Usage

tnrs_sources(source = NULL)

Arguments

source The source to get information on, one of "iPlant_TNRS", "NCBI", or "MSW3".

Value

Sources for the TNRS API. 62 tpl_get

Examples

## Not run: # All tnrs_sources()

# A specific source tnrs_sources(source="NCBI")

## End(Not run)

tpl_get Get csv files.

Description

The Plant List http://www.theplantlist.org/. Note that there is now a package on CRAN (taxonstand - http://cran.r-project.org/web/packages/Taxonstand/) that uses only thep- lantlist.org to search plant names.

Usage tpl_get(dir_, family = NULL)

Arguments

dir_ Directory to write csv files to. family If you want just one, or >1 family, but not all, list them in a vector.

Details

Throws a warning if you already have a directory of the one provided, but still works.

Value

Returns nothing to console, except a message and progress bar. Writes csv files to dir_.

Examples

tpl_get(dir_ = "~/foo") # writes to your home directory, change to where you want tpl_get(dir_ = "~/foo2", family = c("Platanaceae","Winteraceae")) # just a few families tpl_search 63

tpl_search A light wrapper around the taxonstand fxn to call Theplantlist.org database.

Description A light wrapper around the taxonstand fxn to call Theplantlist.org database.

Usage tpl_search(taxon, paral = FALSE, ...)

Arguments taxon A taxonomic name, or a vector of names. paral Paralellize or not (logical). Which back-end package you use depends on your operating system and just general taste. Possibilities include: snow, multicore, parallel, doMC, etc. ... Further arguments passed on to the TPLck function of Taxonstand. See TPLck for arguments.

Examples

# Regular non-parallel splist <- c("Heliathus annuus","Abies procera","Poa annua","Platanus occidentalis", " abrupta","Arctostaphylos canescens","Ocimum basilicum","Vicia faba", "Quercus kelloggii","Lactuca serriola") tpl_search(taxon = splist)

# Use more arguments within TPLck tpl_search(taxon = "Microbryum curvicollum", corr = TRUE) tpl_search(taxon = "Microbryum curvicollum", corr = TRUE, max.distance=5)

tp_acceptednames Return all accepted names for a taxon name with a given id.

Description Return all accepted names for a taxon name with a given id.

Usage tp_acceptednames(id, format = "json", output = "df", url = "http://services.tropicos.org/Name/", key = NULL) 64 tp_namedistributions

Arguments id the taxon identifier code format return in json or xml format (defaults to json) output raw = json or xml; or df = data.frame url The Tropicos url for the function (should be left to default). key Your Tropicos API key; loads from .Rprofile.

Value List or dataframe.

Examples

## Not run: tp_acceptednames(id = 25503923) tp_acceptednames(id = 25503923, output = ’raw’)

## End(Not run)

tp_namedistributions Return all distribution records for for a taxon name with a given id.

Description Return all distribution records for for a taxon name with a given id.

Usage tp_namedistributions(id, format = "json", output = "df", url = "http://services.tropicos.org/Name/", key = NULL)

Arguments id the taxon identifier code format return in json or xml format (defaults to json) output raw = json or xml; or df = data.frame url The Tropicos url for the function (should be left to default). key Your Tropicos API key; loads from .Rprofile.

Value List or dataframe. tp_namereferences 65

Examples ## Not run: # Raw json or xml tp_namedistributions(id = 25509881, output = ’raw’)

# Output as data.frame df <- tp_namedistributions(id = 25509881) df[df$category %in% ’Location’,] # just location data df[df$category %in% ’Reference’,] # just reference data

## End(Not run)

tp_namereferences Return all reference records for for a taxon name with a given id.

Description Return all reference records for for a taxon name with a given id.

Usage tp_namereferences(id, format = "json", output = "df", url = "http://services.tropicos.org/Name/", key = NULL)

Arguments id the taxon identifier code format return in json or xml format (defaults to json) output raw = json or xml; or df = data.frame url The Tropicos url for the function (should be left to default). key Your Tropicos API key; loads from .Rprofile.

Value List or dataframe.

Examples ## Not run: # Raw json or xml tp_namereferences(id = 25509881, output = ’raw’)

# Output as data.frame tp_namereferences(id = 25509881)

## End(Not run) 66 tp_synonyms

tp_summary Return summary data a taxon name with a given id.

Description Return summary data a taxon name with a given id.

Usage tp_summary(id, format = "json", output = "df", url = "http://services.tropicos.org/Name/", key = NULL)

Arguments id the taxon identifier code format return in json or xml format (defaults to json) output raw = json or xml; or df = data.frame url The Tropicos url for the function (should be left to default). key Your Tropicos API key; loads from .Rprofile.

Value List or dataframe.

Examples ## Not run: tp_summary(id = 25509881) tp_summary(id = 25509881, output = ’raw’)

## End(Not run)

tp_synonyms Return all synonyms for a taxon name with a given id.

Description Return all synonyms for a taxon name with a given id.

Usage tp_synonyms(id, format = "json", output = "df", url = "http://services.tropicos.org/Name/", key = NULL) ubio_namebank 67

Arguments id the taxon identifier code format return in json or xml format (defaults to json) output raw = json or xml; or df = data.frame url The Tropicos url for the function (should be left to default). key Your Tropicos API key; loads from .Rprofile.

Value List or dataframe.

Examples ## Not run: tp_synonyms(id = 25509881) tp_synonyms(id = 25509881, output = ’raw’)

## End(Not run)

ubio_namebank Search uBio namebank.

Description Search uBio namebank.

Usage ubio_namebank(searchName = NULL, searchAuth = NULL, searchYear = NULL, order = NULL, sci = NULL, vern = NULL, keyCode = NULL)

Arguments searchName (string) - term to search within name string searchAuth (string) - term to search within name authorship searchYear (string) - term to search within name year order (string) - (name or namebankID) field by which the results will be sorted (default is namebankID) sci (int) - (sci, vern, or all) type of results to be returned (default is all) vern (int) - (limit 1000) maximum number of results to be returned (default is 1000) keyCode Your uBio API key; loads from .Rprofile. If you don’t have one, obtain one at http://www.ubio.org/index.php?pagename=form. 68 ubio_namebank

Details Can’t seem to get json format results along with specifiying an API key, so if you use json your key is not specified at the moment

Value List or dataframe of XXXX.

Examples ## Not run: ubio_namebank(searchName = ’elephant’, sci = 1, vern = 0) ubio_namebank(searchName = ’Astragalus aduncus’, sci = 1, vern = 0)

## End(Not run) Index

∗Topic datasets getacceptednamesfromtsn, 14 rank_ref, 55 getanymatchcount, 15 ∗Topic data getcommentdetailfromtsn, 15 rank_ref, 55 getcommonnamesfromtsn, 16 ∗Topic globalnamesindex getcoremetadatafromtsn, 17 gni_details, 45 getcoveragefromtsn, 17 gni_search, 46 getcredibilityratingfromtsn, 18 ∗Topic names getcredibilityratings, 18 gni_details, 45 getcurrencyfromtsn, 19 gni_search, 46 getdatedatafromtsn, 19 gnr_datasources, 47 getdescription, 20 gnr_resolve, 48 getexpertsfromtsn, 20 ∗Topic package getfullhierarchyfromtsn, 21 taxize-package,4 getfullrecordfromlsid, 22 ∗Topic resolve getfullrecordfromtsn, 22 gnr_datasources, 47 getgeographicdivisionsfromtsn, 23 gnr_resolve, 48 getgeographicvalues, 23 ∗Topic taxonomy getglobalspeciescompletenessfromtsn, gni_details, 45 24 gni_search, 46 gethierarchydownfromtsn, 24 gnr_datasources, 47 gethierarchyupfromtsn, 25 gnr_resolve , 48 getitistermsfromcommonname, 26 getitistermsfromscientificname, 26 capwords,5 getjurisdictionaloriginfromtsn, 27 classification,5 getjurisdictionoriginvalues, 27 col_children,6 getjurisdictionvalues, 28 col_classification,7 getkingdomnamefromtsn, 28 col_downstream,9 getkingdomnames, 29 eol_dataobjects, 10 getlastchangedate, 29 eol_hierarchy, 11 getlsidfromtsn, 30 eol_pages, 12 getothersourcesfromtsn, 30 eol_ping, 13 getparenttsnfromtsn, 31 eol_search, 13 getpublicationsfromtsn, 31 getranknames, 32 get_genes, 39 getrecordfromlsid, 32 get_genes_avail, 40 getreviewyearfromtsn, 33 get_seqs, 41 getscientificnamefromtsn, 34 get_tsn, 42 getsynonymnamesfromtsn, 34 get_uid, 43 gettaxonauthorshipfromtsn, 35

69 70 INDEX gettaxonomicranknamefromtsn, 36 gettaxonomicusagefromtsn, 36 gettsnbyvernacularlanguage, 37 gettsnfromlsid, 37 getunacceptabilityreasonfromtsn, 38 getvernacularlanguages, 39 gisd_isinvasive, 44 gni_details, 45 gni_search, 45, 46, 46 gnr_datasources, 45, 46, 47 gnr_resolve, 48 itis_acceptname, 49 itis_downstream, 49 itis_name, 50 itis_phymat_format, 51 itis_taxrank, 51 iucn_summary, 52 phylomatic_tree, 53 plantminer, 54 rank_ref, 55 searchbycommonname, 55 searchbycommonnamebeginswith, 56 searchbycommonnameendswith, 56 searchbyscientificname, 57 searchforanymatch, 58 searchforanymatchpaged, 58 tax_name, 59 taxize (taxize-package),4 taxize-package,4 tnrs, 60 tnrs_sources, 61 tp_acceptednames, 63 tp_namedistributions, 64 tp_namereferences, 65 tp_summary, 66 tp_synonyms, 66 tpl_get, 62 tpl_search, 63 ubio_namebank, 67