-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathREADME.Rmd
199 lines (147 loc) · 7.34 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
output: md_document
---
[![CRAN Version (Stable)](http://www.r-pkg.org/badges/version/soilDB)](https://cran.r-project.org/package=soilDB)
[![GitHub Version (Development)](https://img.shields.io/badge/GitHub-`r packageVersion("soilDB")`-yellowgreen)](https://github.com/ncss-tech/soilDB)
[![R-CMD-check Build Status](https://github.com/ncss-tech/soilDB/workflows/R-CMD-check/badge.svg)](https://github.com/ncss-tech/soilDB/actions)
[![Total CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/soilDB)](https://cran.r-project.org/package=soilDB)
![CRAN/METACRAN](https://img.shields.io/cran/l/soilDB)
[![soilDB Manual](https://img.shields.io/badge/docs-HTML-informational)](https://ncss-tech.github.io/soilDB/docs)
## Installation
Get the stable version from CRAN:
```r
install.packages('soilDB', dependencies = TRUE)
```
Get the development version from GitHub:
```r
remotes::install_github("ncss-tech/soilDB", dependencies = FALSE, upgrade = FALSE, build = FALSE)
```
## Website
- http://ncss-tech.github.io/AQP/
## soilDB `r packageVersion("soilDB")`
### Notices on Database Interfaces
#### NASIS
* low-level functions return empty `data.frame` objects when local database (or selected set) is empty
* `fetchNASIS()` is now a wrapper around pedon and component "fetch" functions
* `uncode()` is now used in all queries to local NASIS database
#### Soil Data Access (SDA)
* `SDA_query` returns a `try-error` for queries with invalid syntax or on network error; empty results are an empty `data.frame()`
* `fetchSDA_spatial` can return STATSGO `gsmmupolygon` or Soil Survey Area `sapolygon` data; and can join to the `legend` table
#### Other APIs
* **NEW** functions [`ROSETTA`](http://ncss-tech.github.io/soilDB/docs/reference/ROSETTA.html), [`taxaExtent`](http://ncss-tech.github.io/soilDB/docs/reference/taxaExtent.html), [`mukey.wcs`](http://ncss-tech.github.io/soilDB/docs/reference/mukey.wcs.html), [`ISSR800.wcs`](http://ncss-tech.github.io/soilDB/docs/reference/ISSR800.wcs.html)
## Functions by Data Source
* SDA
+ [`fetchSDA`](http://ncss-tech.github.io/soilDB/docs/reference/fetchSDA_component.html)
+ [`fetchSDA_spatial`](http://ncss-tech.github.io/soilDB/docs/reference/fetchSDA_spatial.html)
+ [`SDA_query`](http://ncss-tech.github.io/soilDB/docs/reference/SDA_query.html)
+ [`SDA_spatialQuery`](http://ncss-tech.github.io/soilDB/docs/reference/SDA_spatialQuery.html)
* SSURGO Local Geodatabases
+ [`fetchGDB`](http://ncss-tech.github.io/soilDB/docs/reference/fetchGDB.html)
* NASIS local database
+ [`fetchNASIS`](http://ncss-tech.github.io/soilDB/docs/reference/fetchNASIS.html)
* ROSETTA
+ <span style="color:red">**NEW:**</span> [`ROSETTA`](http://ncss-tech.github.io/soilDB/docs/reference/ROSETTA.html)
* SSURGO/KSSL via SoilWeb
+ [`fetchKSSL`](http://ncss-tech.github.io/soilDB/docs/reference/fetchKSSL.html)
+ [`fetchOSD`](http://ncss-tech.github.io/soilDB/docs/reference/fetchOSD.html)
+ [`siblings`](http://ncss-tech.github.io/soilDB/docs/reference/siblings.html)
+ [`OSDquery`](http://ncss-tech.github.io/soilDB/docs/reference/OSDquery.html)
+ [`seriesExtent`](http://ncss-tech.github.io/soilDB/docs/reference/seriesExtent.html)
+ <span style="color:red">**NEW:**</span> [`taxaExtent`](http://ncss-tech.github.io/soilDB/docs/reference/taxaExtent.html)
+ <span style="color:red">**NEW:**</span> [`mukey.wcs`](http://ncss-tech.github.io/soilDB/docs/reference/mukey.wcs.html)
+ <span style="color:red">**NEW:**</span> [`ISSR800.wcs`](http://ncss-tech.github.io/soilDB/docs/reference/ISSR800.wcs.html)
* NASIS WWW interface
+ [`parseWebReport`](http://ncss-tech.github.io/soilDB/docs/reference/parseWebReport.html)
+ [`fetchNASISWebReport`](http://ncss-tech.github.io/soilDB/docs/reference/fetchNASISWebReport.html)
* SCAN/SNOTEL
+ [`fetchSCAN`](http://ncss-tech.github.io/soilDB/docs/reference/fetchSCAN.html)
+ [`SCAN_SNOTEL_metadata`](http://ncss-tech.github.io/soilDB/docs/reference/SCAN_SNOTEL_metadata.html)
* Henry Mount Soil and Water Database
+ [`fetchHenry`](http://ncss-tech.github.io/soilDB/docs/reference/fetchHenry.html)
* SoilGrids
+ [`fetchSoilGrids`](http://ncss-tech.github.io/soilDB/docs/reference/fetchSoilGrids.html)
## Miscellaneous Functions
* [`estimateSTR`](http://ncss-tech.github.io/soilDB/docs/reference/estimateSTR.html)
* [`STRplot`](http://ncss-tech.github.io/soilDB/docs/reference/STRplot.html)
* [`KSSL_VG_model`](http://ncss-tech.github.io/soilDB/docs/reference/KSSL_VG_model.html)
* [`simplfyFragmentData`](http://ncss-tech.github.io/soilDB/docs/reference/simplfyFragmentData.html)
* [`simplifyColorData`](http://ncss-tech.github.io/soilDB/docs/reference/simplifyColorData.html)
* [`uncode`](http://ncss-tech.github.io/soilDB/docs/reference/uncode.html)
* [`code`](http://ncss-tech.github.io/soilDB/docs/reference/code.html)
* [`get_NOAA_GHCND`](http://ncss-tech.github.io/soilDB/docs/reference/get_NOAA_GHCND.html)
## Tutorials and Demonstrations
* [fetchKSSL](http://ncss-tech.github.io/AQP/soilDB/KSSL-demo.html)
* [SDA_query](http://ncss-tech.github.io/AQP/soilDB/SDA-tutorial.html)
* [fetchOSD](http://ncss-tech.github.io/AQP/sharpshootR/OSD-dendrogram.html)
* [SCAN/SNOTEL Data](http://ncss-tech.github.io/AQP/soilDB/fetchSCAN-demo.html)
## Related Packages
* [aqp](https://github.com/ncss-tech/aqp)
* [sharpshootR](https://github.com/ncss-tech/sharpshootR)
## Examples
```{r setup, warning = FALSE, message = FALSE, include = FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE,
fig.width = 14, fig.height = 8,
fig.path = ".github/images/",
fig.retina = 3)
```
### Load Soil Packages
```{r packages}
library(aqp)
library(soilDB)
library(sharpshootR)
```
### Get Official Series Description Data
```{r osd}
# get morphology + extended summaries
soils <- c('cecil', 'altavista', 'lloyd', 'wickham', 'woodbridge', 'chewacla', 'congaree')
s <- fetchOSD(soils, extended = TRUE)
```
### Visualize Soil-Landscape Relationships
```{r hillslope, fig.width=11, fig.height=5}
# viz of hillslope position, from SSURGO component records
res <- vizHillslopePosition(s$hillpos, annotation.cex = 0.9)
print(res$fig)
```
### Make Profile Sketches
```{r sketches}
par(mar = c(0, 1, 0, 4), xpd = NA)
plotSPC(
s$SPC,
plot.order = res$order,
cex.names = 1,
axis.line.offset = -0.1,
width = 0.2
)
```
### Identify Tabular "Siblings"
```{r siblings}
s <- 'Amador'
amador <- siblings(s, only.major = FALSE, component.data = TRUE)
# limit to named soil series
sib.data <- subset(amador$sib.data, !compkind %in% c('Miscellaneous area', 'Family', 'Taxon above family'))
# get parsed OSD records
sibs <- fetchOSD(c(s, unique(amador$sib$sibling)), extended = TRUE)
```
### Plot Dendrograms with Taxonomic Relationships
```{r dendrogram}
# invert colors
par(mar = c(0, 0, 0, 0),
fg = 'white',
bg = 'black')
SoilTaxonomyDendrogram(
sibs$SPC,
dend.width = 1.5,
y.offset = 0.4,
scaling.factor = 0.02,
width = 0.2,
cex.taxon.labels = 1,
cex.names = 1
)
```
```{r include=FALSE}
if (!dir.exists("docs/.github/images/"))
dir.create("docs/.github/images/", recursive = TRUE)
file.copy(list.files(path = ".github/images/", "png", full.names = TRUE), "docs/.github/images/")
```
## Dependency Graph
![](https://cran.microsoft.com/packagedata/graphs/soilDB.png)