-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
156 lines (99 loc) · 5.46 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![R-CMD-check](https://github.com/ncss-tech/SoilTaxonomy/workflows/R-CMD-check/badge.svg)](https://github.com/ncss-tech/SoilTaxonomy/actions/workflows/R-CMD-check.yml)
[![Codecov test coverage](https://codecov.io/gh/ncss-tech/SoilTaxonomy/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ncss-tech/SoilTaxonomy?branch=master)
[![CRAN Status](https://www.r-pkg.org/badges/version-last-release/SoilTaxonomy)](https://cran.r-project.org/package=SoilTaxonomy)
[![runiverse-SoilTaxonomy](https://ncss-tech.r-universe.dev/badges/SoilTaxonomy)](https://github.com/ncss-tech/SoilTaxonomy)
[![SoilTaxonomy Manual](https://img.shields.io/badge/docs-HTML-informational)](https://ncss-tech.github.io/SoilTaxonomy/)
<!-- badges: end -->
# {SoilTaxonomy}
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**.
## Installation
Get the stable version from CRAN.
```r
install.packages("SoilTaxonomy")
```
Get the development version from GitHub.
```r
remotes::install_github("ncss-tech/SoilTaxonomy")
```
```{r}
library(SoilTaxonomy)
```
### Soil Taxonomy Dictionaries
```{r}
# hierarchy: order to subgroup
data('ST', package = 'SoilTaxonomy')
# unique taxa: just the taxon names (in order that they "key out" in the keys)
data('ST_unique_list', package = 'SoilTaxonomy')
# formative element dictionary
data('ST_formative_elements', package = 'SoilTaxonomy')
# codes denoting higher taxonomic parent-child relationships (12th Edition Keys to Soil Taxonomy)
data('ST_higher_taxa_codes_12th', package = 'SoilTaxonomy')
# definitions of diagnostic features and characteristics (12th Edition Keys to Soil Taxonomy)
data('ST_features', package = 'SoilTaxonomy')
# definitions of family-level classes and differentiae (12th Edition Keys to Soil Taxonomy)
data('ST_family_classes', package = 'SoilTaxonomy')
```
### Vignettes
Several vignettes are included with the package to demonstrate basic functionality:
- [Taxon Letter Codes in Soil Taxonomy](https://ncss-tech.github.io/SoilTaxonomy/articles/taxon-letter-codes.html)
- [Diagnostic Features & Characteristics](https://ncss-tech.github.io/SoilTaxonomy/articles/diagnostics.html)
- [Family-level Taxonomic Classes](https://ncss-tech.github.io/SoilTaxonomy/articles/family-level_taxonomy.html)
### Featured Functions
Two helpful functions that make use of the internal lookup tables are `getTaxonAtLevel()`, `taxonTree()`, and `explainST()`
#### `getTaxonAtLevel()`: Get taxonomic levels within higher taxonomic groups
##### HHCH = _Acrudoxic Plinthic Kandiudults_
```{r}
getTaxonAtLevel('acrudoxic plinthic kandiudults') # level = "order" # default
getTaxonAtLevel('acrudoxic plinthic kandiudults', level = "suborder")
getTaxonAtLevel('acrudoxic plinthic kandiudults', level = "greatgroup")
getTaxonAtLevel('acrudoxic plinthic kandiudults', level = "subgroup")
```
##### BA = _Folists_
```{r}
getTaxonAtLevel('folists')
getTaxonAtLevel('folists', level = "suborder")
getTaxonAtLevel('folists', level = "greatgroup")
getTaxonAtLevel('folists', level = "subgroup")
```
#### `taxonTree()`: Create `data.tree` representation of Soil Taxonomy Hierarchy
```{r}
# all hapludults and hapludalfs (to subgroup level)
taxonTree(c("hapludults", "hapludalfs"))
```
```{r}
# suborders and great groups of alfisols
taxonTree("alfisols", root = "Alfisols", level = c("suborder", "greatgroup"))
```
#### `explainST()`: Label formative elements with brief explanations
`explainST()` provides simple narrative explanations of the formative elements of taxa at the Order, Suborder, Great Group or Subgroup levels.
```{r}
cat(explainST('folistels'))
cat(explainST('typic endoaqualfs'))
cat(explainST('abruptic haplic durixeralfs'))
# convert "taxon code" to taxon name (subgroup)
cat(explainST(taxon_code_to_taxon("ABCD"))) # ABCD = gypsic anhyturbels
# all soil orders (LETTERS[1:12]; taxon codes A through L)
res <- lapply(LETTERS[1:12], function(l) cat(explainST(taxon_code_to_taxon(l)), "\n\n"))
```
## Static Databases
The `./inst/extdata` folder (formerly `./databases`) of the GitHub repository formerly contained data tables related to taxonomic and map unit concepts within the U.S. Soil Survey Geographic Database (SSURGO).
These databases included:
- Statistics on taxonomic subgroups, family-level components, and soil series.
- MLRA Overlap tables for series, national map unit symbols and map unit keys.
- Summaries of KSSL records per series as well as geomorphic position, parent material origin and kind.
These tables have been moved to a dedicated repository called [SoilWeb-data](https://github.com/ncss-tech/SoilWeb-data).