Learn R Programming

taxize (version 0.7.0)

sci2comm: Get common names from scientific names.

Description

Get common names from scientific names.

Usage

sci2comm(...)

## S3 method for class 'default': sci2comm(scinames, db = "eol", simplify = TRUE, ...)

## S3 method for class 'uid': sci2comm(id, ...)

## S3 method for class 'tsn': sci2comm(id, simplify = TRUE, ...)

Arguments

...
Further arguments passed on to functions get_uid, get_tsn.
scinames
character; One or more scientific names or partial names.
db
character; Data source, one of "eol" (default), "itis" or "ncbi". Note that each taxonomic data source has their own identifiers, so that if you provide the wrong db value for the identifier you could get a result,
simplify
(logical) If TRUE, simplify output to a vector of names. If FALSE, return variable formats from different sources, usually a data.frame. Only applies to eol and itis.
id
character; identifiers, as returned by get_tsn, get_uid.

Value

  • List of character vectors.

Details

Note that EOL requires an API key. You can pass in your EOL api key in the function call like sci2comm('Helianthus annuus', key=""). You can also store your EOL API key in your .Rprofile file as options(eolApiKey = ""), or just for the current session by running options(eolApiKey = "") in the console.

See Also

searchbycommonname, searchbycommonnamebeginswith, searchbycommonnameendswith, eol_search, tp_search, comm2sci

Examples

Run this code
sci2comm(scinames='Helianthus annuus', db='eol')
sci2comm(scinames='Helianthus annuus', db='itis')
sci2comm(scinames=c('Helianthus annuus', 'Poa annua'))
sci2comm(scinames='Puma concolor', db='ncbi')

# Passing id in, works for sources: itis and ncbi, not eol
sci2comm(get_tsn('Helianthus annuus'))
sci2comm(get_uid('Helianthus annuus'))

# Don't simplify returned
sci2comm(get_tsn('Helianthus annuus'), simplify=FALSE)

# Use curl options
library("httr")
sci2comm(scinames='Helianthus annuus', config=verbose())
sci2comm('Helianthus annuus', db="itis", config=verbose())
sci2comm('Helianthus annuus', db="ncbi", config=verbose())

Run the code above in your browser using DataLab