metacoder (version 0.1.2)

taxonomy_ranks: Get ordered ranks from taxonomy

Description

Returns an ordered factor of the ranks of a given taxonomy. It also checks if rank corresponds consistently with level.

Usage

taxonomy_ranks(taxa, parents, rank, strict = TRUE)

Arguments

taxa
(character) Unique taxon IDs for every possible taxon.
parents
(character) Unique taxon IDs for the supertaxa of every possible taxon. Root taxa should have NA in this column.
rank
(character) The rank designation (e.g. "genus") corresponding to each observation in taxa.
strict
If FALSE, ranks with inconsistent levels will be allowed. Otherwise ranks with overlapping level ranges will cause an error.