filtering-helpers: Taxonomic filtering helpers

filtering-helpersR Documentation

Taxonomic filtering helpers

Description

Taxonomic filtering helpers

Usage

ranks(...)

nms(...)

ids(...)

Arguments

...

quoted rank names, taxonomic names, taxonomic ids, or any of those with supported operators (See Supported Relational Operators below)

How do these functions work?

Each function assigns some metadata so we can more easily process your query downstream. In addition, we check for whether you've used any relational operators and pull those out to make downstream processing easier

The goal of these functions is to make it easy to combine queries based on each of rank names, taxonomic names, and taxonomic ids.

These are designed to be used inside of [pop()], [pick()], [span()]. Inside of those functions, we figure out what rank names you want to filter on, then check against a reference dataset ([ranks_ref]) to allow ordered queries like I want all taxa between Class and Genus. If you provide rank names, we just use those, then do the filtering you requested. If you provide taxonomic names or ids we figure out what rank names you are referring to, then we can proceed as in the previous sentence.

Supported Relational Operators

  • '>' all items above rank of x

  • '>=' all items above rank of x, inclusive

  • '<' all items below rank of x

  • '<=' all items below rank of x, inclusive

ranks

Ranks can be any character string in the set of acceptable rank names.

nms

'nms' is named to avoid using 'names' which would collide with the fxn [base::names()] in Base R. Can pass in any character taxonomic names.

ids

Ids are any alphanumeric taxonomic identifier. Some database providers use all digits, but some use a combination of digits and characters.

Note

NSE is not supported at the moment, but may be in the future

Examples

ranks("genus")
ranks("order", "genus")
ranks("> genus")

nms("Poaceae")
nms("Poaceae", "Poa")
nms("< Poaceae")

ids(4544)
ids(4544, 4479)
ids("< 4479")

metacoder documentation built on April 4, 2023, 9:08 a.m.