Skip to content

Commit b8a053e

Browse files
updates
1 parent 416654f commit b8a053e

File tree

2 files changed

+685
-12
lines changed

2 files changed

+685
-12
lines changed

AQP/aqp/series-color-TP-graph.Rmd

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ mtext('KSSL data correllated to Holland series', at=0.5, adj = 0)
6262

6363
Compute depth-wise transition probability matrix for moist colors. Visualize as a graph organized by communities.
6464
```{r, fig.width=9, fig.height=9}
65-
# # remove profile #8
66-
# idx <- (1:length(s))[-8]
65+
# # remove profile #10
66+
# idx <- (1:length(s))[-10]
6767
# s <- s[idx, ]
6868
6969
# generate TP matrix from horizon moist colors
@@ -121,7 +121,7 @@ plot(g, edge.arrow.size = 0.5, vertex.label.cex = 0.55, vertex.label.family = "s
121121
```
122122

123123

124-
Simulate moist color sequences using Markov chains derived from transition probability matrix. Weight the TP matrix (and MC?) by working from 1cm slices. Does this make sense? Probably not.
124+
Simulate moist color sequences using Markov chains derived from transition probability matrix. Weight the TP matrix (and MC?) by working from 1cm slices. Need to think about this some more.
125125
```{r fig.width=8, fig.height=5}
126126
# re-make TP matrix, this time including terminal loops
127127
s.slices <- dice(s, 0:150 ~ .)
@@ -131,7 +131,7 @@ tp.loops <- hzTransitionProbabilities(s.slices, name = "color", loopTerminalStat
131131
mc <- new("markovchain", states = dimnames(tp.loops)[[1]], transitionMatrix = tp.loops)
132132
133133
# investigate the most common surface horizon colors
134-
sort(table(s$color[grep('^A', s$hzn_desgn)]), decreasing = TRUE)
134+
sort(table(s[, 1]$color), decreasing = TRUE)
135135
136136
# simulate 30 sequences, starting with the most common A horizon moist color
137137
munsell.sequence <- replicate(30, rmarkovchain(n = 150, object = mc, include.t0 = TRUE, t0 = "7.5YR 3/2"))
@@ -163,6 +163,33 @@ rect(xleft = 31.5, ybottom = 10 * seq_along(ml) - 0.5, xright = 32.5, ytop = 20
163163
```
164164

165165

166+
Combine horizons with the same color.
167+
```{r fig.width=8, fig.height=5}
168+
z <- data.frame(
169+
id = 'S',
170+
top = 0,
171+
bottom = 151,
172+
color = NA
173+
)
174+
175+
depths(z) <- id ~ top + bottom
176+
z <- duplicate(z, times = 30)
177+
178+
plotSPC(z)
179+
180+
z <- dice(z, 0:150 ~ .)
181+
182+
z$color <- do.call('c', lapply(1:ncol(col.sequence), function(i) {col.sequence[, i]}))
183+
184+
zz <- collapseHz(z, by = 'color')
185+
186+
par(mar = c(0, 0, 0, 2.5))
187+
plotSPC(zz, color = 'color', width = 0.35)
188+
189+
```
190+
191+
192+
166193

167194

168195

0 commit comments

Comments
 (0)