From 753c23b72a217ff2f2be7207669bed96c7170ca9 Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Fri, 17 Jan 2025 16:55:30 -0800 Subject: [PATCH] ex2.2: ohz --- data/book/02/ohz.R | 26 ++++++++++++++++++++++++++ data/book/02/ohz.rda | Bin 0 -> 1315 bytes 2 files changed, 26 insertions(+) create mode 100644 data/book/02/ohz.R create mode 100644 data/book/02/ohz.rda diff --git a/data/book/02/ohz.R b/data/book/02/ohz.R new file mode 100644 index 00000000..49eb61e7 --- /dev/null +++ b/data/book/02/ohz.R @@ -0,0 +1,26 @@ +library(aqp) + +set.seed(456) + +d <- list( + id = "P", + name = c(c("Oe", "Oa", "A", "Cg1", "Cg2")), + depths = c(28, 30, 50, 100, 250), + soil_color = c("10YR 2/2", "10YR 2/1", "7.5YR 2.5/1", "10Y 4/1", "2.5Y 5/1"), + soc = c(30, 32, 4, 0.8, 0.5), + bdy = aqp::hzDistinctnessCodeToOffset(c( + "gradual", "gradual", "clear", "diffuse", "clear" + )) +) + +ohz <- aqp::quickSPC(d, ) |> + aqp::perturb(n = 10, boundary.attr = "bdy") |> + trunc(0, 200) + +ohz$soc <- pmax(0.1, jitter(ohz$soc, abs(log10(ohz$soc) * (ohz$bottom - ohz$top)))) +ohz$soc[runif(nrow(ohz)) > 0.97] <- NA + +plot(ohz) +plot(ohz, color='soc') + +save(ohz, file ="../data/book/02/ohz.rda") diff --git a/data/book/02/ohz.rda b/data/book/02/ohz.rda new file mode 100644 index 0000000000000000000000000000000000000000..f684034ec88d3d50d1b7551220f1aad2d4b6f845 GIT binary patch literal 1315 zcmV+;1>E`{iwFP!000002JKjHY*SSfzpv}YT3~A+E^!k>A~6bXtna=4nQnWxV;j_A zHenkbQN~-_wGZ3Au6+}ziJOraC4`7DqDH@<2}X=0hG`5zW%xxBryzz8CX3;ZI_Ctw zfH85kuf6xQ?~PHVL=)Znu=9K8{_gqRd(TVn&e_oH;mjU0LZ}ECjRsUyoPwyhtFyJ* ziBQU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