-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval-corestrictive-features.R
69 lines (39 loc) · 3.3 KB
/
eval-corestrictive-features.R
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
library(aqp)
library(ragg)
## combined mu/component data, as SPC
x <- readRDS('data/combined-tab-data-SPC.rds')
## how does the use of restrictive features differ between survey types
.res <- diagnostic_hz(x)
xtabs(~ reskind + which, data = .res)
## demonstrations
# unique subset of components
x.u <- unique(x, vars = c('hzdept_r', 'hzdepb_r', 'hzname', 'compname', 'localphase'))
table(x$source)
table(x.u$source)
# SSURGO
x.sub <- subset(x.u, source == 'SSURGO')
length(x.sub)
par(mar = c(0, 0, 3, 1))
plotSPC(x.sub, label = 'compname', name.style = 'center-center', width = 0.35, depth.axis = list(style = 'compact', line = -3, cex = 0.8), col.label = 'Texture Class (<2mm fraction)', color = 'texture')
## TODO: split over 2 rows
agg_png(filename = 'figures/SSURGO-unique-comp-rest-features-sketches.png', width = 2800, height = 650, scaling = 1.5)
par(mar = c(0, 0, 3, 1))
plotSPC(x.sub, label = 'compname', id.style = 'top', cex.id = 0.66, cex.names = 0.85, name.style = 'center-center', width = 0.35, depth.axis = list(style = 'compact', line = -3, cex = 0.8), col.label = 'Texture Class (<2mm fraction)', color = 'texture', col.palette = hcl.colors(10, 'vik', rev = TRUE))
addDiagnosticBracket(x.sub, kind = 'Lithic bedrock', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 2, tick.length = 0, lwd = 4)
addDiagnosticBracket(x.sub, kind = 'Paralithic bedrock', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 3, tick.length = 0, lwd = 4)
addDiagnosticBracket(x.sub, kind = 'Strongly contrasting textural stratification', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 4, tick.length = 0, lwd = 4)
legend('topright', legend = c('lithic contact', 'paralithic', 'strongly contrasting textural change'), cex = 0.8, bty = 'n', lwd = 3, col = 2:4, xpd = NA, inset = c(0, -0.06))
dev.off()
# RSS
x.sub <- subset(x.u, source == 'RSS')
length(x.sub)
par(mar = c(0, 0, 3, 1))
plotSPC(x.sub, label = 'compname', name.style = 'center-center', width = 0.35, depth.axis = list(style = 'compact', line = -3, cex = 0.8), col.label = 'Texture Class (<2mm fraction)', color = 'texture')
agg_png(filename = 'figures/RSS-unique-comp-rest-features-sketches.png', width = 1800, height = 650, scaling = 1.5)
par(mar = c(0, 0, 3, 1))
plotSPC(x.sub, label = 'compname', id.style = 'top', cex.id = 0.66, cex.names = 0.85, name.style = 'center-center', width = 0.35, depth.axis = list(style = 'compact', line = -3, cex = 0.8), col.label = 'Texture Class (<2mm fraction)', color = 'texture', col.palette = hcl.colors(10, 'vik', rev = TRUE))
addDiagnosticBracket(x.sub, kind = 'Lithic bedrock', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 2, tick.length = 0, lwd = 4)
addDiagnosticBracket(x.sub, kind = 'Paralithic bedrock', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 3, tick.length = 0, lwd = 4)
addDiagnosticBracket(x.sub, kind = 'Strongly contrasting textural stratification', feature = 'reskind', top = 'resdept_r', bottom = 'resdepb_r', offset = -0.5, col = 4, tick.length = 0, lwd = 4)
legend('topright', legend = c('lithic contact', 'paralithic', 'strongly contrasting textural change'), cex = 0.8, bty = 'n', lwd = 3, col = 2:4, xpd = NA, inset = c(0, -0.06))
dev.off()