Learn R Programming

binomen (version 0.1.2)

parts: Pick out parts by name

Description

This suite of functions act on taxon or taxonref objects, and pick out object elements by the name of the function.

Usage

name(x, unname = TRUE)

# S3 method for taxon name(x, unname = TRUE)

# S3 method for taxonref name(x, unname = TRUE)

uri(x, unname = TRUE)

# S3 method for taxon uri(x, unname = TRUE)

# S3 method for taxonref uri(x, unname = TRUE)

rank(x, unname = TRUE)

# S3 method for taxon rank(x, unname = TRUE)

# S3 method for taxonref rank(x, unname = TRUE)

taxonid(x, unname = TRUE)

# S3 method for taxon taxonid(x, unname = TRUE)

# S3 method for taxonref taxonid(x, unname = TRUE)

Arguments

x
Input, object of class taxon or taxonref
unname
(logical) Unname output elements? Ignored when input is of class taxonref. Default: TRUE

Value

For taxon inputs, gives back a taxonref object. For taxondf inputs, gives back taxondf.

Examples

Run this code
# operating on `taxon` objects
out <- make_taxon(genus="Poa", epithet="annua", authority="L.",
   family='Poaceae', clazz='Poales', kingdom='Plantae', variety='annua')

out %>% name()
out %>% uri()
out %>% rank()
out %>% taxonid()

## or don't unname the output
out %>% name(unname = FALSE)

# operating on `taxonref` objects
res <- taxonref("genus", "Poa", 56, "http://scottchamberlain.info/")
res %>% name()
res %>% uri()
res %>% rank()
res %>% taxonid()

Run the code above in your browser using DataLab