level_hierarchy {SoilTaxonomy} | R Documentation |
Order of Hierarchical Levels in Soil Taxonomy
Description
Creates an ordered factor such that different levels (the values used in level
arguments to various SoilTaxonomy package functions) in the Soil Taxonomy hierarchy can be distinguished or compared to one another.
Usage
level_hierarchy(
x = c("order", "suborder", "greatgroup", "subgroup", "family"),
family = TRUE,
as.is = FALSE
)
Arguments
x |
Passed as input to |
family |
Allow |
as.is |
Return |
Details
The levels of Soil Taxonomy hierarchy include: "family"
, "subgroup"
, "greatgroup"
, "suborder"
, "order"
. The "order"
is a level above "suborder"
. "subgroup"
and above are "taxa above family"
. Note: "family"
is always included as the "lowest" level when the result is an ordered factor, even when family-level input is disallowed by family=FALSE
.
Value
An ordered factor with the values "order", "suborder", "greatgroup", "subgroup". or character when as.is=TRUE
.
Examples
# is great group a taxon above family?
level_hierarchy("greatgroup") > "family"
# is order lower level than suborder?
level_hierarchy("order") < "suborder"
# what levels are above or equal to a particular taxon's level?
level_hierarchy(as.is = TRUE)[level_hierarchy() >= taxon_to_level("aquisalids")]
## this produces an error (used for checking for taxa above family)
# level_hierarchy("family", family = FALSE)