Title: | A System of Soil Classification for Making and Interpreting Soil Surveys |
---|---|
Description: | Taxonomic dictionaries, formative element lists, and functions related to the maintenance, development and application of U.S. Soil Taxonomy. Data and functionality are based on official U.S. Department of Agriculture sources including the latest edition of the Keys to Soil Taxonomy. Descriptions and metadata are obtained from the National Soil Information System or Soil Survey Geographic databases. Other sources are referenced in the data documentation. Provides tools for understanding and interacting with concepts in the U.S. Soil Taxonomic System. Most of the current utilities are for working with taxonomic concepts at the "higher" taxonomic levels: Order, Suborder, Great Group, and Subgroup. |
Authors: | Andrew Brown [aut, cre], Dylan Beaudette [aut] |
Maintainer: | Andrew Brown <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.6 |
Built: | 2024-10-31 05:36:24 UTC |
Source: | https://github.com/ncss-tech/soiltaxonomy |
Determine taxonomic level of a taxonomic letter code
code_to_level(code)
code_to_level(code)
code |
A character vector of taxon codes (case sensitive) |
A character vector containing "order"
, "suborder"
, "greatgroup"
or "subgroup"
# order level code (1 character) code_to_level("B") # subgroup level code (4 characters) code_to_level("ABCD") # subgroup level code (5 characters, 4 uppercase + 1 lowercase) code_to_level("IFFZh")
# order level code (1 character) code_to_level("B") # subgroup level code (4 characters) code_to_level("ABCD") # subgroup level code (5 characters, 4 uppercase + 1 lowercase) code_to_level("IFFZh")
Find all codes that logically comprise the specified codes. For instance, code "ABC" ("Anhyturbels") returns "A" ("Gelisols"), "AB" ("Turbels"), "ABC" ("Anhyturbels"). Use in conjunction with a lookup table that maps Order, Suborder, Great Group and Subgroup taxa to their codes (see taxon_code_to_taxon
and taxon_to_taxon_code
).
decompose_taxon_code(codes)
decompose_taxon_code(codes)
codes |
A character vector of taxon codes to "decompose" – case sensitive |
Accounts for Keys that run out of capital letters (more than 26 subgroups) and use lowercase letters for a unique subdivision within the "fourth character position."
A list with equal length to input vector; one character vector per element
preceding_taxon_codes
, taxon_code_to_taxon
, taxon_to_taxon_code
decompose_taxon_code(c("ABC", "ABCDe", "BCDEf"))
decompose_taxon_code(c("ABC", "ABCDe", "BCDEf"))
Explain a taxon name using formative elements
explainST(x, format = c("text", "html"), viewer = TRUE)
explainST(x, format = c("text", "html"), viewer = TRUE)
x |
a Subgroup, Great Group, Suborder or Order-level taxonomic name; matching is exact and case-insensitive |
format |
output format: 'text' | 'html' |
viewer |
show |
a block of text, suitable for display in fixed-width font
cat(explainST("ids"), "\n\n") # -ids (order suffix) cat(explainST("aridisols"), "\n\n") # Aridisols (order name) cat(explainST("argids"), "\n\n") # Arg- (suborder) cat(explainST("haplargids"), "\n\n") # Hap- (great group) cat(explainST("typic haplargids"), "\n\n") # Typic (subgroup)
cat(explainST("ids"), "\n\n") # -ids (order suffix) cat(explainST("aridisols"), "\n\n") # Aridisols (order name) cat(explainST("argids"), "\n\n") # Arg- (suborder) cat(explainST("haplargids"), "\n\n") # Hap- (great group) cat(explainST("typic haplargids"), "\n\n") # Typic (subgroup)
Extract Soil Moisture Regime from Subgroup or Higher Level Taxon
extractSMR(taxon, as.is = FALSE, droplevels = FALSE, ordered = TRUE)
extractSMR(taxon, as.is = FALSE, droplevels = FALSE, ordered = TRUE)
taxon |
character. Vector of taxon names. |
as.is |
Return character labels rather than an (ordered) factor? Default: |
droplevels |
Drop unused levels? Default: |
ordered |
Create an ordinal factor? Default: |
an (ordered) factor of Soil Moisture Regimes, or character vector when as.is=TRUE
extractSMR(c("aquic haploxeralfs", "typic epiaqualfs", "humic inceptic eutroperox"))
extractSMR(c("aquic haploxeralfs", "typic epiaqualfs", "humic inceptic eutroperox"))
Identify formative elements in taxon names at Soil Order, Suborder, Great Group or Subgroup level
FormativeElements(x, level = c("order", "suborder", "greatgroup", "subgroup")) OrderFormativeElements(x) SubOrderFormativeElements(x) GreatGroupFormativeElements(x) SubGroupFormativeElements(x) get_ST_formative_elements( level = c("order", "suborder", "greatgroup", "subgroup") )
FormativeElements(x, level = c("order", "suborder", "greatgroup", "subgroup")) OrderFormativeElements(x) SubOrderFormativeElements(x) GreatGroupFormativeElements(x) SubGroupFormativeElements(x) get_ST_formative_elements( level = c("order", "suborder", "greatgroup", "subgroup") )
x |
A character vector containing subgroup-level taxonomic names |
level |
one of |
A list containing $defs
: a data.frame
containing taxonomic elements, derivations, connotations and links. And $char.index
: a numeric denoting the position where the formative element occurs in the search text x
get_ST_formative_elements()
: a data.frame containing descriptors of formative elements used at the specified level
D.E. Beaudette, A.G. Brown
FormativeElements("acrudoxic plinthic kandiudults", level = "subgroup") SubGroupFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "greatgroup") GreatGroupFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "suborder") SubOrderFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "order") OrderFormativeElements("acrudoxic plinthic kandiudults")
FormativeElements("acrudoxic plinthic kandiudults", level = "subgroup") SubGroupFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "greatgroup") GreatGroupFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "suborder") SubOrderFormativeElements("acrudoxic plinthic kandiudults") FormativeElements("acrudoxic plinthic kandiudults", level = "order") OrderFormativeElements("acrudoxic plinthic kandiudults")
All parameters to this function are optional (default NULL
). If specified, they are used as filters.
get_ST_family_classes( classname = NULL, group = NULL, name = NULL, chapter = NULL, page = NULL, multiline_sep = "\n", multiline_col = "criteria" )
get_ST_family_classes( classname = NULL, group = NULL, name = NULL, chapter = NULL, page = NULL, multiline_sep = "\n", multiline_col = "criteria" )
classname |
optional filtering vector; levels of |
group |
optional filtering vector; one or more of: |
name |
optional filtering vector; one or more of: |
chapter |
optional filtering vector for chapter number |
page |
optional filtering vector; page number (12th Edition Keys to Soil Taxonomy) |
multiline_sep |
default |
multiline_col |
character. vector of "multi-line" column names to concatenate. Default: |
This is a wrapper method around the package data set ST_family_classes
.
a data.frame
a subset of ST_family_classes
data.frame
ST_family_classes
ST_features
get_ST_features()
# get classes in chapter 17 str(get_ST_family_classes(chapter = 17)) # get classes on page 323 get_ST_family_classes(page = 323) # get the description for the mesic temperature class from list column str(get_ST_family_classes(classname = "mesic")$description)
# get classes in chapter 17 str(get_ST_family_classes(chapter = 17)) # get classes on page 323 get_ST_family_classes(page = 323) # get the description for the mesic temperature class from list column str(get_ST_family_classes(classname = "mesic")$description)
All parameters to this function are optional (default NULL
). If specified, they are used as filters.
get_ST_features( group = NULL, chapter = NULL, name = NULL, page = NULL, multiline_sep = "\n", multiline_col = "criteria" )
get_ST_features( group = NULL, chapter = NULL, name = NULL, page = NULL, multiline_sep = "\n", multiline_col = "criteria" )
group |
optional filtering vector; one of: |
chapter |
optional filtering vector for chapter number |
name |
optional filtering vector; these are the "names" of features used in headers |
page |
optional filtering vector; page number (12th Edition Keys to Soil Taxonomy) |
multiline_sep |
default |
multiline_col |
character. vector of "multi-line" column names to concatenate. Default: |
This is a wrapper method around the package data set ST_features
.
a subset of ST_features
data.frame
ST_features
ST_family_classes
get_ST_family_classes()
# get all features str(get_ST_features()) # get features in chapter 3 str(get_ST_features(chapter = 3)) # get features on pages 18, 19, 20 get_ST_features(page = 18:20) # get the required characteristics for the mollic epipedon from list column str(get_ST_features(name = "Mollic Epipedon")$criteria)
# get all features str(get_ST_features()) # get features in chapter 3 str(get_ST_features(chapter = 3)) # get features on pages 18, 19, 20 get_ST_features(page = 18:20) # get the required characteristics for the mollic epipedon from list column str(get_ST_features(name = "Mollic Epipedon")$criteria)
Get the lower (child) taxa for a taxon name or code
getChildTaxa( taxon = NULL, code = NULL, convert = TRUE, level = c("order", "suborder", "greatgroup", "subgroup") )
getChildTaxa( taxon = NULL, code = NULL, convert = TRUE, level = c("order", "suborder", "greatgroup", "subgroup") )
taxon |
A character vector of taxa (case-insensitive) |
code |
A character vector of taxon codes (case sensitive) |
convert |
Convert results from taxon codes to taxon names? Default: TRUE |
level |
Filter results to specific level? Default: |
A named list, where names are taxon codes and values are character vectors representing parent taxa
# suborder children of "Mollisols" getChildTaxa("Mollisols", level = "suborder") # get all children within a great group, given a subgroup getChildTaxa(getTaxonAtLevel("Ultic Haploxeralfs", "greatgroup"))
# suborder children of "Mollisols" getChildTaxa("Mollisols", level = "suborder") # get all children within a great group, given a subgroup getChildTaxa(getTaxonAtLevel("Ultic Haploxeralfs", "greatgroup"))
Get last child taxon in Keys at specified taxonomic level
getLastChildTaxon(level = c("order", "suborder", "greatgroup"))
getLastChildTaxon(level = c("order", "suborder", "greatgroup"))
level |
Get child taxa from keys at specified level. One of: |
A data.frame
containing key
(parent key), taxon
(last taxon name), code
(letter code), position
(relative taxon position)
# get last taxa in suborder-level keys x <- getLastChildTaxon(level = "suborder") # proportion of keys where last taxon has "Hap" formative element prop.table(table(grepl("^Hap", x$taxon)))
# get last taxa in suborder-level keys x <- getLastChildTaxon(level = "suborder") # proportion of keys where last taxon has "Hap" formative element prop.table(table(grepl("^Hap", x$taxon)))
Must specify either taxon
or code
. taxon
is used if both are specified.
getParentTaxa( taxon = NULL, code = NULL, convert = TRUE, level = c("order", "suborder", "greatgroup", "subgroup") )
getParentTaxa( taxon = NULL, code = NULL, convert = TRUE, level = c("order", "suborder", "greatgroup", "subgroup") )
taxon |
A character vector of taxa (case-insensitive) |
code |
A character vector of taxon codes (case sensitive) |
convert |
Convert results from taxon codes to taxon names? Default: |
level |
level Filter results to specific level? Default: |
A named list, where names are taxon codes and values are character vectors representing parent taxa
getParentTaxa("ultic haploxeralfs") getParentTaxa(code = c("ABCD", "DABC")) getParentTaxa("folists", convert = FALSE)
getParentTaxa("ultic haploxeralfs") getParentTaxa(code = c("ABCD", "DABC")) getParentTaxa("folists", convert = FALSE)
Get the taxon name at the Soil Order, Suborder, Great Group or Subgroup level
getTaxonAtLevel(x, level = "order", simplify = TRUE)
getTaxonAtLevel(x, level = "order", simplify = TRUE)
x |
A character vector containing subgroup-level taxonomic names |
level |
one of |
simplify |
Return a vector when |
A named character vector of taxa at specified level, where names are the internal Soil Taxonomy letter codes. When length(level) > 1
? a data.frame is returned with column names for each level
.
# default gets the soil order getTaxonAtLevel(c("typic haplargids", "typic glacistels")) #, level = "order") # specify alternate levels getTaxonAtLevel("humic haploxerands", level = "greatgroup") # can't get subgroup (child) from great group (parent) getTaxonAtLevel("udifolists", level = "subgroup") # but can do parents of children getTaxonAtLevel("udifolists", level = "suborder") # specify multiple levels (returns a list element for each level) getTaxonAtLevel("hapludolls", c("order", "suborder", "greatgroup", "subgroup"))
# default gets the soil order getTaxonAtLevel(c("typic haplargids", "typic glacistels")) #, level = "order") # specify alternate levels getTaxonAtLevel("humic haploxerands", level = "greatgroup") # can't get subgroup (child) from great group (parent) getTaxonAtLevel("udifolists", level = "subgroup") # but can do parents of children getTaxonAtLevel("udifolists", level = "suborder") # specify multiple levels (returns a list element for each level) getTaxonAtLevel("hapludolls", c("order", "suborder", "greatgroup", "subgroup"))
Checks needle
for matches against a single level of Soil Taxonomy hierarchy: order
, suborder
, greatgroup
, subgroup
. Matches are case-insensitive.
isValidST(needle, level = c("order", "suborder", "greatgroup", "subgroup"))
isValidST(needle, level = c("order", "suborder", "greatgroup", "subgroup"))
needle |
vector of taxa |
level |
single level of Soil Taxonomy hierarchy; one of: |
logical
vector, same length as needle
isValidST('typic haploxeralfs', level = 'subgroup')
isValidST('typic haploxeralfs', level = 'subgroup')
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.
level_hierarchy( x = c("order", "suborder", "greatgroup", "subgroup", "family"), family = TRUE, as.is = FALSE )
level_hierarchy( x = c("order", "suborder", "greatgroup", "subgroup", "family"), family = TRUE, as.is = FALSE )
x |
Passed as input to |
family |
Allow |
as.is |
Return |
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
.
An ordered factor with the values "order", "suborder", "greatgroup", "subgroup". or character when as.is=TRUE
.
# 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)
# 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)
Convenience method for getting taxa from ST_unique_list
level_to_taxon(level = c("order", "suborder", "greatgroup", "subgroup"))
level_to_taxon(level = c("order", "suborder", "greatgroup", "subgroup"))
level |
character. One or more of "order", "suborder", "greatgroup", "subgroup" |
A character vector of taxa at the specified level
# get all order and suborder level taxa level_to_taxon(level = c("order","suborder"))
# get all order and suborder level taxa level_to_taxon(level = c("order","suborder"))
This function generates Newick tree format strings for a single tree. Taxa are assigned relative positions within their parent to indicate the order that they "key out."
newick_string( x = NULL, level = c("suborder", "greatgroup", "subgroup"), what = c("taxon", "code") )
newick_string( x = NULL, level = c("suborder", "greatgroup", "subgroup"), what = c("taxon", "code") )
x |
Optional: a taxon name to get children of. |
level |
Level to build the tree at. One of |
what |
Either |
The output from this function is a character string with parenthetical format encoding a single tree suitable for input into functions such as ape::read.tree()
. Multiple trees can be combined together in the file or text string supplied to your tree-parsing function of choice.
character. A single tree in parenthetical Newick or New Hampshire format.
if (requireNamespace("ape")) { par(mar = c(0, 0, 0, 0)) # "fan" mytr <- ape::read.tree(text = newick_string(level = "suborder")) plot(mytr, "f", rotate.tree = 180, cex = 0.75) # "cladogram" mytr <- ape::read.tree(text = newick_string("durixeralfs", level = "subgroup")) plot(mytr, "c") # "cladogram" (using taxon codes instead of subgroups) mytr <- ape::read.tree(text = newick_string("xeralfs", level = "subgroup", what = "code")) plot(mytr, "c") dev.off() }
if (requireNamespace("ape")) { par(mar = c(0, 0, 0, 0)) # "fan" mytr <- ape::read.tree(text = newick_string(level = "suborder")) plot(mytr, "f", rotate.tree = 180, cex = 0.75) # "cladogram" mytr <- ape::read.tree(text = newick_string("durixeralfs", level = "subgroup")) plot(mytr, "c") # "cladogram" (using taxon codes instead of subgroups) mytr <- ape::read.tree(text = newick_string("xeralfs", level = "subgroup", what = "code")) plot(mytr, "c") dev.off() }
Parent/Child Hierarchy
parent_level(level, n = 1) child_level(level, n = 1)
parent_level(level, n = 1) child_level(level, n = 1)
level |
character. Initial level name of a taxon. Vectors include values that are one of: |
n |
Number of levels above/below (parent/child). Default: |
character. Level name of parent or child at specified level above input level
.
parent_level('subgroup') child_level('greatgroup') parent_level('family', 3) # no level above order parent_level('family', 5)
parent_level('subgroup') child_level('greatgroup') parent_level('family', 3) # no level above order parent_level('family', 5)
Parse components of a "family-level" taxon name
parse_family(family, column_metadata = TRUE, flat = TRUE)
parse_family(family, column_metadata = TRUE, flat = TRUE)
family |
character. vector of taxonomic families, e.g. |
column_metadata |
logical. include parsed NASIS physical column names and values from family taxon components? Default: |
flat |
logical Default: |
a data.frame
containing column names: "family"
(input), "subgroup"
(parsed taxonomic subgroup), "subgroup_code"
(letter code for subgroup), "class_string"
(comma-separated family classes), "classes_split"
(split class_string
vector stored as list
column).
In addition, the following column names are identified and returned based on NASIS (National Soil Information System) metadata (via soilDB package):
"taxpartsize"
, "taxpartsizemod"
, "taxminalogy"
, "taxceactcl"
, "taxreaction"
, "taxtempcl"
, "taxfamhahatmatcl"
, "taxfamother"
, "taxsubgrp"
, "taxgreatgroup"
, "taxsuborder"
, "taxorder"
if (requireNamespace('soilDB')) { families <- c("fine, kaolinitic, thermic typic kanhapludults", "fine-loamy, mixed, semiactive, mesic ultic haploxeralfs", "euic, thermic typic haplosaprists", "coarse-loamy, mixed, active, mesic aquic dystrudepts") # inspect parsed list result str(parse_family(families)) }
if (requireNamespace('soilDB')) { families <- c("fine, kaolinitic, thermic typic kanhapludults", "fine-loamy, mixed, semiactive, mesic ultic haploxeralfs", "euic, thermic typic haplosaprists", "coarse-loamy, mixed, active, mesic aquic dystrudepts") # inspect parsed list result str(parse_family(families)) }
Find all codes that logically precede the specified codes. For instance, code "ABC" ("Anhyturbels") returns "AA" ("Histels") "ABA" ("Histoturbels") and "ABB" ("Aquiturbels"). Use in conjunction with a lookup table that maps Order, Suborder, Great Group and Subgroup taxa to their codes (see taxon_code_to_taxon
and taxon_to_taxon_code
).
preceding_taxon_codes(codes)
preceding_taxon_codes(codes)
codes |
A character vector of codes to calculate preceding codes for |
Accounts for Keys that run out of capital letters (more than 26 subgroups) and use lowercase letters for a unique subdivision within the "fourth character position."
A list with equal length to input vector; one character vector per element
decompose_taxon_code
, taxon_code_to_taxon
, taxon_to_taxon_code
preceding_taxon_codes(c("ABCDe", "BCDEf"))
preceding_taxon_codes(c("ABCDe", "BCDEf"))
The relative position of a taxon is [number of preceding Key steps] + 1
, or NA
if it does not exist in the lookup table.
relative_taxon_code_position(code)
relative_taxon_code_position(code)
code |
A character vector of taxon codes to determine the relative position of. |
A numeric vector with the relative position of each code with respect to their individual Keys.
# "ABCD" -> "Gypsic Anhyturbels", relative position 7 # "WXYZa" does not exist, theoretical position is 97 # "BAD" -> "Udifolists", relative position is 5 relative_taxon_code_position(c("ABCD", "WXYZa", "BAD")) # [1] 7 NA 5
# "ABCD" -> "Gypsic Anhyturbels", relative position 7 # "WXYZa" does not exist, theoretical position is 97 # "BAD" -> "Udifolists", relative position is 5 relative_taxon_code_position(c("ABCD", "WXYZa", "BAD")) # [1] 7 NA 5
Get (Ordered) Factors based on Soil Taxonomy Key position
SoilTaxonomyLevels( level = c("order", "suborder", "greatgroup", "subgroup"), as.is = FALSE, ordered = TRUE ) SoilMoistureRegimeLevels(as.is = FALSE, ordered = TRUE) SoilTemperatureRegimeLevels(as.is = FALSE, ordered = TRUE)
SoilTaxonomyLevels( level = c("order", "suborder", "greatgroup", "subgroup"), as.is = FALSE, ordered = TRUE ) SoilMoistureRegimeLevels(as.is = FALSE, ordered = TRUE) SoilTemperatureRegimeLevels(as.is = FALSE, ordered = TRUE)
level |
One of: |
as.is |
Return character labels rather than an (ordered) factor? Default: |
ordered |
Create an ordinal factor? Default: |
an (ordered) factor or character vector (when as.is=TRUE
)
SoilTaxonomyLevels("order") SoilTaxonomyLevels("order", ordered = FALSE) SoilTaxonomyLevels("order", as.is = TRUE) SoilTaxonomyLevels("suborder")
SoilTaxonomyLevels("order") SoilTaxonomyLevels("order", ordered = FALSE) SoilTaxonomyLevels("order", as.is = TRUE) SoilTaxonomyLevels("suborder")
The first 4 levels of the US Soil Taxonomy hierarchy (soil order, suborder, greatgroup, subgroup), presented as a data.frame
(denormalized) and a list
of unique taxa.
data(ST)
data(ST)
An object of class data.frame
with 2665 rows and 9 columns.
Ordered based on the unique letter codes denoting taxa from the 13th edition of the Keys to Soil Taxonomy.
Soil Survey Staff. 1999. Soil taxonomy: A basic system of soil classification for making and interpreting soil surveys. 2nd edition. Natural Resources Conservation Service. U.S. Department of Agriculture Handbook 436. https://www.nrcs.usda.gov/resources/guides-and-instructions/soil-taxonomy
Soil Survey Staff. 2014. Keys to Soil Taxonomy, 12th ed. USDA-Natural Resources Conservation Service, Washington, DC. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
A database of family-level class names for Soil Taxonomy.
data(ST_family_classes)
data(ST_family_classes)
An object of class data.frame
with 193 rows and 8 columns.
Soil Survey Staff. 2014. Keys to Soil Taxonomy, 12th ed. USDA-Natural Resources Conservation Service, Washington, DC. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
A data.frame
with columns "group", "name", "chapter", "page", "description", "criteria". Currently page numbers and contents are referenced to 12th Edition Keys to Soil Taxonomy and derived from products in the ncss-tech SoilKnowledgeBase repository (https://github.com/ncss-tech/SoilKnowledgeBase).
data(ST_features)
data(ST_features)
An object of class data.frame
with 84 rows and 6 columns.
Soil Survey Staff. 2014. Keys to Soil Taxonomy, 12th ed. USDA-Natural Resources Conservation Service, Washington, DC. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
A database of formative elements used by the first 4 levels of US Soil Taxonomy hierarchy (soil order, suborder, greatgroup, subgroup).
data(ST_formative_elements)
data(ST_formative_elements)
An object of class list
of length 4.
S. W. Buol and R. C. Graham and P. A. McDaniel and R. J. Southard. Soil Genesis and Classification, 5th edition. Iowa State Press, 2003.
A lookup table mapping unique taxonomic Order, Suborder, Great Group and Subgroups to letter codes that denote their logical position within the Keys.
data(ST_higher_taxa_codes_12th)
data(ST_higher_taxa_codes_12th)
An object of class data.frame
with 3082 rows and 2 columns.
The lookup table has been corrected to reflect errata that were posted after the print publication of the 12th Edition Keys, as well as typos in the Spanish language edition.
Soil Survey Staff. 2014. Keys to Soil Taxonomy, 12th ed. USDA-Natural Resources Conservation Service, Washington, DC. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
Soil Survey Staff. 2014. Claves para la Taxonomía de Suelos, 12th ed. USDA-Natural Resources Conservation Service, Washington, DC. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
A lookup table mapping unique taxonomic Order, Suborder, Great Group and Subgroups to letter codes that denote their logical position within the Keys.
data(ST_higher_taxa_codes_13th)
data(ST_higher_taxa_codes_13th)
An object of class data.frame
with 3153 rows and 2 columns.
Soil Survey Staff. 2022. Keys to Soil Taxonomy, 13th ed. USDA-Natural Resources Conservation Service. https://www.nrcs.usda.gov/resources/guides-and-instructions/keys-to-soil-taxonomy
Convert taxon code to taxon name
taxon_code_to_taxon(code)
taxon_code_to_taxon(code)
code |
A character vector of Taxon Codes |
A character vector of matching Taxon Names
decompose_taxon_code
, preceding_taxon_codes
, taxon_to_taxon_code
taxon_code_to_taxon(c("ABC", "XYZ", "DAB", NA))
taxon_code_to_taxon(c("ABC", "XYZ", "DAB", NA))
Taxa that resolve to a subgroup level taxon and contain a comma ","
are assumed to be "family"
-level.
taxon_to_level(taxon)
taxon_to_level(taxon)
taxon |
character vector of taxon names at Order, Suborder, Great Group or Subgroup level. |
character of taxonomic hierarchy levels (such as "order", "suborder", "greatgroup", "subgroup", "family") for each element of input vector.
# get the taxonomic levels for various taxa taxon_to_level(c("gelisols", NA, "foo", "typic folistels", "folistels"))
# get the taxonomic levels for various taxa taxon_to_level(c("gelisols", NA, "foo", "typic folistels", "folistels"))
Convert taxon name to taxon code
taxon_to_taxon_code(taxon)
taxon_to_taxon_code(taxon)
taxon |
A character vector of taxon names, case insensitive |
A character vector of matching taxon codes
decompose_taxon_code
, preceding_taxon_codes
, taxon_code_to_taxon
taxon_to_taxon_code(c("Anhyturbels", "foo", "Cryaquands", NA))
taxon_to_taxon_code(c("Anhyturbels", "foo", "Cryaquands", NA))
data.tree
Object from Taxon NamesThis function takes one or more taxon names and taxonomic levels as input.
taxonTree( taxon, level = c("order", "suborder", "greatgroup", "subgroup"), root = "Soil Taxonomy", verbose = TRUE, special.chars = c("|--", "|", "|", "-"), file = "", ... )
taxonTree( taxon, level = c("order", "suborder", "greatgroup", "subgroup"), root = "Soil Taxonomy", verbose = TRUE, special.chars = c("|--", "|", "|", "-"), file = "", ... )
taxon |
A vector of taxon names |
level |
One or more of: |
root |
Label for root node. Default: |
verbose |
Print tree output? Default: |
special.chars |
Characters used to print the tree to console. Default: |
file |
Optional: path to output file. Default: |
... |
Additional arguments to |
A subclass of data.tree Node
object is returned. This object has a custom print()
method
A SoilTaxonNode
(subclass of data.tree
Node
) object (invisibly). A text representation of the tree is printed to stdout when verbose=TRUE
.
# hapludults and hapludalfs (to subgroup level) taxonTree(c("hapludults", "hapludalfs")) # alfisols suborders and great groups taxonTree("alfisols", root = "Alfisols", level = c("suborder", "greatgroup"))
# hapludults and hapludalfs (to subgroup level) taxonTree(c("hapludults", "hapludalfs")) # alfisols suborders and great groups taxonTree("alfisols", root = "Alfisols", level = c("suborder", "greatgroup"))
A list containing three data.frame elements "rsg"
, "pq"
, and "sq"
providing information on the 'Representative Soil Groups', 'Principal Qualifiers,' and 'Supplementary Qualifiers,' respectively.
data(WRB_4th_2022)
data(WRB_4th_2022)
An object of class list
of length 3.
Each element has the column "code"
which is a number (1-32) referring to the position in the Reference Soil Groups, and the column "reference_soil_group"
which is the corresponding group name. The "pq"
and "sq"
qualifier name columns (primary_qualifier
and supplementary_qualifier
) contain individual qualifier terms. Related qualifiers are identified using qualifier_group
column derived from qualifier names separated with a forward slash " / "
The data.frame "rsg"
has column "criteria"
, describing the logical criteria for each Reference Soil Group.
The data.frame "pq"
has qualifier names in column "principal_qualifier"
The data.frame "sq"
has column "supplementary_qualifier"
.
IUSS Working Group WRB. 2022. World Reference Base for Soil Resources. International soil classification system for naming soils and creating legends for soil maps. 4th edition. International Union of Soil Sciences (IUSS), Vienna, Austria.