The siblings of any given soil series are defined as those soil components (major and minor) that share a parent map unit with the named series (as a major component). Component names are filtered using a snapshot of the Soil Classification database to ensure that only valid soil series names are included. Cousins are siblings of siblings. Data are sourced from SoilWeb which maintains a copy of the current SSURGO snapshot. Visualizations of soil “siblings”-related concepts can be found in the “Sibling Summary” tab of Soil Data Explorer.
Recreate functionality of previous API.
library(aqp)
library(soilDB)
library(sharpshootR)
library(latticeExtra)
library(reshape2)
library(cluster)
library(ape)
library(corrplot)
# new function as of 2.2-8
# get sibling data for Amador soil series via SoilWeb
# note that sib$sib may contain duplicates, based on major/minor component status
s <- siblings('amador', component.data = TRUE)
str(s)
## List of 2
## $ sib :'data.frame': 17 obs. of 4 variables:
## ..$ series : chr [1:17] "amador" "amador" "amador" "amador" ...
## ..$ sibling : chr [1:17] "Pardee" "Miltonhills" "Gillender" "Vleck" ...
## ..$ majcompflag: logi [1:17] TRUE TRUE TRUE TRUE FALSE FALSE ...
## ..$ n : int [1:17] 8 6 2 1 15 14 11 5 5 4 ...
## $ sib.data:'data.frame': 158 obs. of 7 variables:
## ..$ areasymbol : chr [1:158] "ca630" "ca630" "ca630" "ca630" ...
## ..$ mukey : int [1:158] 2600529 2600529 2600529 2600529 2600529 2600537 2600537 2600537 2600537 2600537 ...
## ..$ cokey : int [1:158] 26412041 26412042 26412043 26412044 26412045 26412054 26412050 26412051 26412049 26412052 ...
## ..$ compname : chr [1:158] "Miltonhills" "Amador" "Ultic Argixerolls" "Pardee" ...
## ..$ comppct_r : int [1:158] 50 30 10 5 5 60 15 10 8 5 ...
## ..$ compkind : chr [1:158] "Series" "Series" "Family" "Series" ...
## ..$ majcompflag: chr [1:158] "Yes" "Yes" "No " "No " ...
# convert into adjacency matrix
m <- component.adj.matrix(
s$sib.data[s$sib.data$compkind == 'Series', ],
mu = 'mukey',
co = 'compname',
wt = 'comppct_r'
)
A simple depiction of the resulting adjacency matrix. Cell values are adjacency weight (strength of association).
.cp <- c('white', hcl.colors(25, palette = 'spectral'))
corrplot(
m,
col = .cp,
is.corr = FALSE,
diag = TRUE,
col.lim = c(0, 1),
method = "color",
type = "upper",
tl.pos = "td",
tl.cex = 0.8,
tl.col = 'black',
addgrid.col = 'black'
)
Adjacency as a network.
# plot network diagram, with Amador soil highlighted
par(mar = c(0.5,0.5,0.5,0.5))
plotSoilRelationGraph(
m,
s = 'Amador',
vertex.scaling.factor = 2,
edge.transparency = 0.75,
edge.col = grey(0.85),
edge.highlight.col = 'black',
vertex.label.family = 'sans'
)
| series | sibling | majcompflag | n |
|---|---|---|---|
| amador | Pardee | TRUE | 8 |
| amador | Miltonhills | TRUE | 6 |
| amador | Gillender | TRUE | 2 |
| amador | Vleck | TRUE | 1 |
| amador | Miltonhills | FALSE | 15 |
| amador | Pardee | FALSE | 14 |
| amador | Redding | FALSE | 11 |
| amador | Hornitos | FALSE | 5 |
| amador | Gillender | FALSE | 5 |
| amador | Exchequer | FALSE | 4 |
| amador | Pentz | FALSE | 4 |
| amador | Vleck | FALSE | 2 |
| amador | Jennylind | FALSE | 2 |
| amador | Peters | FALSE | 2 |
| amador | Ranchoseco | FALSE | 2 |
| amador | Inks | FALSE | 1 |
| amador | Corning | FALSE | 1 |
Split sibling lists and get basic morphology from OSDs.
idx <- which(s$sib$majcompflag)
major.siblings <- c(s$sib$series[1], s$sib$sibling[idx])
all.siblings <- unique(c(s$sib$series[1], s$sib$sibling))
# get basic OSD data for queried series and siblings
h.major <- fetchOSD(major.siblings)
h.all <- fetchOSD(all.siblings)
Siblings that are major components.
SoilTaxonomyDendrogram(h.major, depth.axis = list(line = -4))
All siblings.
SoilTaxonomyDendrogram(h.all, width = 0.3, depth.axis = list(line = -3.5))
Cousins are siblings of siblings. This can generate a lot of output.
# takes a while to run, there will be duplicates in counsins here
s <- siblings('amador', component.data = TRUE, cousins = TRUE)
# combine sibling + cousin data, remove duplicates
d <- unique(rbind(s$sib.data, s$cousin.data))
# subset to components that are correlated to a soil series
d <- d[which(d$compkind == 'Series'), ]
# convert into adjacency matrix
m <- component.adj.matrix(d, mu = 'mukey', co = 'compname', wt = 'comppct_r')
Adjaceny matrix.
corrplot(
m,
col = .cp,
is.corr = FALSE,
diag = TRUE,
col.lim = c(0, 1),
method = "color",
type = "upper",
tl.pos = "td",
tl.cex = 0.8,
tl.col = 'black',
addgrid.col = 'black'
)
Adjaceny network.
# plot network diagram, with Amador soil highlighted
par(mar=c(1,1,1,1))
plotSoilRelationGraph(
m,
s = 'Amador',
vertex.scaling.factor = 2,
edge.transparency = 0.75,
edge.col = grey(0.85),
edge.highlight.col = 'black',
vertex.label.family = 'sans'
)
Try on your own, this is too much data to “see” all in one figure.
# fetch and convert data into an SPC
h <- fetchOSD(c(s$sib$series[1], unique(s$cousins$sibling)))
# plot dendrogram + profiles
SoilTaxonomyDendrogram(h, width = 0.3)
s.all.siblings <- fetchOSD(all.siblings, extended = TRUE)
Compare hillslope position.
res <- vizHillslopePosition(s.all.siblings$hillpos, s = 'AMADOR')
print(res$fig)
Compare geomorphic component.
res <- vizGeomorphicComponent(s.all.siblings$geomcomp, s = 'AMADOR')
print(res$fig)
This document is based on aqp version 2.3.1,
soilDB version 2.9.0, and sharpshootR version
2.4.1.