-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ideas on automating paneled approach to sketching large SPCs
- Loading branch information
1 parent
646e057
commit 09560b0
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
library(soilDB) | ||
library(aqp) | ||
|
||
x <- fetchNASIS() | ||
|
||
x <- HzDepthLogicSubset(x) | ||
|
||
sdc <- getSoilDepthClass(x) | ||
site(x) <- sdc | ||
|
||
z <- subset(x, depth > 40) | ||
z <- subset(z, !is.na(soil_color)) | ||
|
||
z$texcl <- factor(z$texcl, levels = SoilTextureLevels()) | ||
|
||
# z <- combine(lapply(1:216, random_profile, SPC = TRUE)) | ||
|
||
|
||
|
||
# suggestions for even numbers | ||
.s <- 1:length(z) | ||
.fidx <- which(length(z) %% .s == 0) | ||
.s[.fidx] | ||
|
||
|
||
.size <- 72 | ||
z$.chunk <- makeChunks(seq_along(z), size = .size) | ||
.chunkIds <- unique(z$.chunk) | ||
.n <- length(.chunkIds) | ||
|
||
## TODO: this doesn't work for thematic sketches, as each panel gets its own legend | ||
|
||
par(mar = c(0, 0, 0, 2), mfrow = c(.n, 1)) | ||
|
||
for(i in .chunkIds) { | ||
.idx <- which(z$.chunk == i) | ||
plotSPC( | ||
z[.idx, ], | ||
print.id = FALSE, | ||
name = NA, | ||
lwd = 0.1, | ||
divide.hz = FALSE, | ||
width = 0.4, | ||
max.depth = 110, | ||
depth.axis = list(line = -4, cex = 1), | ||
n = .size, | ||
# color = 'texcl' | ||
# color = 'p1' | ||
) | ||
} | ||
|