Learn R Programming

taxize (version 0.9.4)

comm2sci: Get scientific names from common names.

Description

Get scientific names from common names.

Usage

comm2sci(commnames, db = "eol", itisby = "search", simplify = TRUE, ...)

Arguments

commnames

One or more common names or partial names.

db

Data source, one of "eol" (default), "itis", "tropicos", "ncbi", or "worms".

itisby

Search for common names across entire names (search, default), at beginning of names (begin), or at end of names (end).

simplify

(logical) If TRUE, simplify output to a vector of names. If FALSE, return variable formats from different sources, usually a data.frame.

...

Further arguments passed on to internal methods.

Value

If simplify=TRUE, a list of scientific names, with list labeled by your input names. If simplify=FALSE, a data.frame with columns that vary by data source

Authentication

See taxize-authentication for help on authentication

Details

For data sources ITIS and NCBI you can pass in common names directly, and use get_uid or get_tsn to get ids first, then pass in to this fxn.

For the other data sources, you can only pass in common names directly.

See Also

sci2comm

Examples

Run this code
# NOT RUN {
comm2sci(commnames='black bear')
comm2sci(commnames='black bear', simplify = FALSE)
comm2sci(commnames='black bear', db='itis')
comm2sci(commnames='annual blue grass', db='tropicos')
comm2sci(commnames=c('annual blue grass','tree of heaven'), db='tropicos')
comm2sci(commnames=c('black bear', 'roe deer'))
comm2sci('blue whale', db = "worms")
comm2sci(c('blue whale', 'dwarf surfclam'), db = "worms")

# Output easily converts to a data.frame with plyr::ldply
library(plyr)
ldply(comm2sci(commnames=c('annual blue grass','tree of heaven'),
  db='tropicos'))

# ncbi: pass in uid's from get_uid() directly
x <- get_uid("western capercaillie", modifier = "Common Name")
comm2sci(x)
# itis: pass in tsn's from get_tsn() directly
x <- get_tsn(c("Louisiana black bear", "american crow"),
  searchtype = "common")
comm2sci(x)
# }

Run the code above in your browser using DataLab