binomen

knitr::opts_chunk$set(
  warning = FALSE,
  message = FALSE,
  collapse = TRUE,
  comment = "#>"
)

Project Status: Moved to https://github.com/ropensci/taxa – The project has been moved to a new location, and the version at that location should be considered authoritative. 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.

classes (S3)

verbs

Installation

Stable CRAN version

install.packages("binomen")

Development GitHub version

install.packages("devtools")
devtools::install_github("ropensci/binomen")
library('binomen')

Make a taxon

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

Subset taxon objects

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)

Taxonomic data.frame's

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)

ToDo

See our issue tracker to see what we have planned

Meta

ropensci



ropensci/binomen documentation built on May 18, 2022, 9:47 a.m.