knitr::opts_chunk$set( warning = FALSE, message = FALSE, collapse = TRUE, comment = "#>" )
to https://github.com/ropensci/taxa
MOST FUNCTIONALITY OF THIS PACKAGE HAS MOVED TO THE taxa PACKAGE. THIS PACKAGE IS NOW ARCHIVED ON CRAN
binomen
provides various taxonomic classes for defining a single taxon, multiple taxa, and a taxonomic data.frame
It is designed as a companion to taxize, where you can get taxonomic data on taxonomic names from the web.
taxon
taxonref
taxonrefs
binomial
grouping
(i.e., classification - used different term to avoid conflict with classification in taxize
)gethier()
- get hierarchy from a taxon
classscatter()
- make each row in taxonomic data.frame (taxondf
) a separate taxon
object within a single taxa
objectassemble()
- make a taxa
object into a taxondf
data.framepick()
- pick out one or more taxonomic groupspop()
- pop out (drop) one or more taxonomic groupsspan()
- pick a range between two taxonomic groups (inclusive)strain()
- filter by taxonomic groups, like dplyr's filtername()
- get the taxon name for each taxonref
objecturi()
- get the reference uri for each taxonref
objectrank()
- get the taxonomic rank for each taxonref
objectid()
- get the reference uri for each taxonref
objectStable CRAN version
install.packages("binomen")
Development GitHub version
install.packages("devtools") devtools::install_github("ropensci/binomen")
library('binomen')
Make a taxon object
(obj <- make_taxon(genus="Poa", epithet="annua", authority="L.", family='Poaceae', clazz='Poales', kingdom='Plantae', variety='annua'))
Index to various parts of the object
The binomial
obj$binomial
The authority
obj$binomial$authority
The classification
obj$grouping
The family
obj$grouping$family
Get one or more ranks via pick()
obj %>% pick(family) obj %>% pick(family, genus)
Drop one or more ranks via pop()
obj %>% pop(family) obj %>% pop(family, genus)
Get a range of ranks via span()
obj %>% span(kingdom, family)
Extract classification as a data.frame
gethier(obj)
Make one
df <- data.frame(order = c('Asterales','Asterales','Fagales','Poales','Poales','Poales'), family = c('Asteraceae','Asteraceae','Fagaceae','Poaceae','Poaceae','Poaceae'), genus = c('Helianthus','Helianthus','Quercus','Poa','Festuca','Holodiscus'), stringsAsFactors = FALSE) (df2 <- taxon_df(df))
Parse - get rank order via pick()
df2 %>% pick(order)
get ranks order, family, and genus via pick()
df2 %>% pick(order, family, genus)
get range of names via span()
, from rank X
to rank Y
df2 %>% span(family, genus)
Separate each row into a taxon
class (many taxon
objects are a taxa
class)
scatter(df2)
And you can re-assemble a data.frame from the output of scatter()
with assemble()
out <- scatter(df2) assemble(out)
See our issue tracker to see what we have planned
binomen
in R doing citation(package = 'binomen')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.