Subtaxonomy: Subtaxonomy under taxonomical category

View source: R/Subtaxonomy.R

SubtaxonomyR Documentation

Subtaxonomy under taxonomical category

Description

Functions to obtain the subtaxonomy or the set of taxa included in a particular taxonomic group, according to the zoologTaxonomy by default.

Usage

Subtaxonomy(
  taxon,
  taxonomy = zoologTaxonomy,
  thesaurus = zoologThesaurus$taxon
)

SubtaxonomySet(
  taxon,
  taxonomy = zoologTaxonomy,
  thesaurus = zoologThesaurus$taxon
)

GetSpeciesIn(
  taxon,
  taxonomy = zoologTaxonomy,
  thesaurus = zoologThesaurus$taxon
)

Arguments

taxon

A name of any of the taxa, at any rank included in the taxonomy (from species to family in the zoolog taxonomy).

taxonomy

A taxonomy from which to extract the subtaxonomy. By default taxonomy = zoologTaxonomy.

thesaurus

A thesaurus allowing datasets with different nomenclatures to be merged. By default thesaurus = zoologThesaurus$taxon.

Value

Subtaxonomy returns a data.frame with the same structure of the input taxonomy but with only the species (rows) included in the queried taxon, and the taxonomic ranks (columns) up to its level.

SubtaxonomySet returns a character vector including a unique copy (set) of all the taxa, at any taxonomic rank, under the queried taxon. Equivalent to Subtaxonomy but as a set instead of a dataframe.

GetSpeciesIn returns a character vector including the species included in the queried taxon.

Examples

## Get species of genus Sus:
GetSpeciesIn("Sus")

## Get species of family Bovidae:
GetSpeciesIn("Bovidae")

## Get the subtaxonomy of the Tribe Caprini:
Subtaxonomy("Caprini")

## Use SubtaxonomySet to join categories for computing log-ratios.
## For this, we read an example dataset:
dataFile <- system.file("extdata", "dataValenzuelaLamas2008.csv.gz",
                        package="zoolog")
dataExample <- utils::read.csv2(dataFile,
                                na.strings = "",
                                encoding = "UTF-8")
## We illustrate with a subset of cases to make the example run
## sufficiently fast:
dataExample <- dataExample[1:1000, ]
## Compute the log-ratios joining all taxa from tribe \emph{Caprini}
## to use the reference of \emph{Ovis aries}:
categoriesCaprini <- list('Ovis aries' = SubtaxonomySet("Caprini"))
dataExampleWithLogs <- LogRatios(dataExample,
                                 joinCategories = categoriesCaprini)

zoolog documentation built on Aug. 26, 2022, 5:08 p.m.