Closed brownag closed 8 months ago
This has been addressed in #46
Should this be handled differently? Currently the derived NASIS-like columns e.g.
taxsuborder
are from decomposing a valid (current taxonomy) subgroup level name, so they returnNA
for taxon above family that aren't subgroup-level.
Now taxa at any level are returned. Two additional columns are added "taxclname" and "code"--these refer to the input taxonomic class and lowest-level letter code (order, suborder, great group or subgroup).
- Is it "valid" to apply family-level classes to taxa above subgroup?
Yes, it is common for higher taxonomic concepts to have specific family level classes associated with them. For instance the temperature regime or particle size class.
- If there is a detectable taxon above subgroup should it be split out?
Yes, and to avoid confusion the subgroup_code and lowest-level (not necessarily subgroup) code are both returned. For taxa above subgroup the value is NA
for any levels that are not defined in the input.
- Should family level classes also be returned (even if not "valid")?
We don't currently have the logic to determine which family level classes are required for particular taxa. The ability to validate whether classes used are appropriate for particular subgroup or higher level taxa could be within the purview of a new function validate_family()
or similar.
- How often are family level
taxaclasses combined with taxa above subgroup in SSURGO?
Some quick queries indicate that more often than not a taxon above family is associated with one or more family-level classes. 70% of taxon above family components have taxpartsize
and/or taxtempregime
.
suppressPackageStartupMessages(library(soilDB))
SDA_query("SELECT COUNT(DISTINCT cokey) FROM component
WHERE compkind = 'taxon above family'")
#> single result set, returning a data.frame
#> V1
#> 1 37312
SDA_query("SELECT COUNT(DISTINCT cokey) FROM component
WHERE compkind = 'taxon above family'
AND taxpartsize IS NOT NULL")
#> single result set, returning a data.frame
#> V1
#> 1 20240
SDA_query("SELECT COUNT(DISTINCT cokey) FROM component
WHERE compkind = 'taxon above family'
AND taxtempregime IS NOT NULL")
#> single result set, returning a data.frame
#> V1
#> 1 23840
SDA_query("SELECT COUNT(DISTINCT cokey) FROM component
WHERE compkind = 'taxon above family'
AND (taxpartsize IS NOT NULL OR taxtempregime IS NOT NULL)")
#> single result set, returning a data.frame
#> V1
#> 1 26621
Consider the following example using
parse_family()
on a taxonomic class field of mixed levels.Note where
taxclname
is: 1) a suborder-level name 2) a subgroup-level name 3) great group-level name with some family level classes specifiedShould this be handled differently? Currently the derived NASIS-like columns e.g.
taxsuborder
are from decomposing a valid (current taxonomy) subgroup level name, so they returnNA
for taxon above family that aren't subgroup-level.