diff --git a/articles/Introduction-to-SoilProfileCollection-Objects.html b/articles/Introduction-to-SoilProfileCollection-Objects.html index d5a57cc26..e2af2985b 100644 --- a/articles/Introduction-to-SoilProfileCollection-Objects.html +++ b/articles/Introduction-to-SoilProfileCollection-Objects.html @@ -364,8 +364,8 @@

Horizon and Site Data#> [1] 21 27 32 55 25 34 3 15 27 32 25 31 33 13 21 23 15 17 12 19 14 14 22 25 40 51 67 24 25 32
 sp4$elevation # vector of simulated elevation (site data)
-
#>  [1] 1243.8475  911.6685 1260.0143 1023.6433  955.5042  976.4431  760.9843 1140.7615  815.0438
-#> [10]  964.1241
+
#>  [1] 1117.0541 1203.1636  839.1829  988.4573  854.7410 1024.3984  943.3412 1151.8720  811.1400
+#> [10]  882.6072
 # unit-length value explicitly targeting site data
 site(sp4)$collection_id <- 1
@@ -421,12 +421,12 @@ 

Horizon and Site Data#> #> ----- Sites (6 / 10 rows | 5 / 5 columns) ----- #> id elevation collection_id constant group -#> colusa 1243.8475 1 1 A -#> glenn 911.6685 1 1 B -#> kings 1260.0143 1 1 A -#> mariposa 1023.6433 1 1 B -#> mendocino 955.5042 1 1 A -#> napa 976.4431 1 1 B +#> colusa 1117.0541 1 1 A +#> glenn 1203.1636 1 1 B +#> kings 839.1829 1 1 A +#> mariposa 988.4573 1 1 B +#> mendocino 854.7410 1 1 A +#> napa 1024.3984 1 1 B #> [... more sites ...] #> #> Spatial Data: @@ -585,16 +585,16 @@

Spatial Data# extract coordinates as matrix getSpatial(sp4)

#>              x       y
-#>  [1,] 353973.8 4109735
-#>  [2,] 353793.7 4109693
-#>  [3,] 353989.8 4109477
-#>  [4,] 354039.0 4109567
-#>  [5,] 354128.1 4109486
-#>  [6,] 353967.1 4109475
-#>  [7,] 354114.3 4109455
-#>  [8,] 354157.6 4109561
-#>  [9,] 354059.2 4109550
-#> [10,] 353882.0 4109505
+#> [1,] 354084.2 4109570 +#> [2,] 354017.7 4109469 +#> [3,] 354007.6 4109562 +#> [4,] 354018.7 4109498 +#> [5,] 353996.5 4109524 +#> [6,] 353991.1 4109616 +#> [7,] 354017.6 4109486 +#> [8,] 353854.3 4109652 +#> [9,] 354019.4 4109427 +#> [10,] 353895.3 4109604
 # get/set spatial reference system using prj()<-
 prj(sp4) <- '+proj=utm +zone=11 +datum=NAD83'
@@ -1640,13 +1640,13 @@ 

Aggregation over “slabs”# note: horizon names are lost due to aggregation head(d.gsm, 7)

#>   variable id    value contributing_fraction top bottom
-#> 1       p1  1 5.920824                 1.000   0      5
-#> 2       p1  1 5.921766                 1.000   5     15
-#> 3       p1  1 5.934649                 1.000  15     30
-#> 4       p1  1 6.176824                 1.000  30     60
-#> 5       p1  1 8.192801                 0.525  60    100
-#> 6       p1  1      NaN                 0.000 100    200
-#> 7       p1  2 6.186225                 1.000   0      5
+#> 1 p1 1 22.20121 1.000 0 5 +#> 2 p1 1 22.20124 1.000 5 15 +#> 3 p1 1 22.23549 1.000 15 30 +#> 4 p1 1 26.59446 1.000 30 60 +#> 5 p1 1 23.13158 1.000 60 100 +#> 6 p1 1 22.43933 0.125 100 200 +#> 7 p1 2 22.94254 1.000 0 5

A simple graphical comparison of the original and re-aligned soil profile data, after converting slab() result from long -> wide format with {data.table} dcast():

diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/plotting-vol-fraction-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/plotting-vol-fraction-1.png index d9961321c..12f1e1db1 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/plotting-vol-fraction-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/plotting-vol-fraction-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-1.png index fe0931b77..5cb9a1f92 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-2.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-2.png index 76ce4a2d3..001f64b54 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-2.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-15-2.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-28-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-28-1.png index 63cdf46d9..e5ded452c 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-28-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-28-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-30-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-30-1.png index 1fa8424ec..27d110a91 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-30-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-30-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-31-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-31-1.png index 5c5f37bfa..560a17cdd 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-31-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-49-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-49-1.png index bdd2dff4f..ebea7241b 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-49-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-49-1.png differ diff --git a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-50-1.png b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-50-1.png index 3677f06ac..b428d5e94 100644 Binary files a/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-50-1.png and b/articles/Introduction-to-SoilProfileCollection-Objects_files/figure-html/unnamed-chunk-50-1.png differ diff --git a/news/index.html b/news/index.html index f8e1cef15..fa0a4bd36 100644 --- a/news/index.html +++ b/news/index.html @@ -67,10 +67,13 @@

Changelog

- +
diff --git a/pkgdown.yml b/pkgdown.yml index 16f7cba47..da690cb20 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -6,5 +6,5 @@ articles: NCSP: NCSP.html label-placement: label-placement.html new-in-aqp-2: new-in-aqp-2.html -last_built: 2023-10-12T05:32Z +last_built: 2023-10-24T20:23Z diff --git a/reference/SANN_1D.html b/reference/SANN_1D.html index bdfdfb285..7df813f42 100644 --- a/reference/SANN_1D.html +++ b/reference/SANN_1D.html @@ -162,15 +162,15 @@

Examples

# easy z <- fixOverlap(x, thresh = 0.2, trace = TRUE) -#> 15 iterations +#> 7 iterations # harder z <- fixOverlap(x, thresh = 0.6, trace = TRUE) -#> 79 iterations +#> 24 iterations # much harder z <- fixOverlap(x, thresh = 0.9, trace = TRUE) -#> 376 iterations +#> 214 iterations # interpret `trace` output diff --git a/reference/index.html b/reference/index.html index 1fa34aefe..5b5f29eac 100644 --- a/reference/index.html +++ b/reference/index.html @@ -741,7 +741,7 @@

All functions

Simulate Soil Colors

-

`[`(<SoilProfileCollection>,<ANY>,<ANY>,<ANY>)

+

`[`(<SoilProfileCollection>)

Matrix/data.frame-like access to profiles and horizons in a SoilProfileCollection

diff --git a/reference/profileInformationIndex-1.png b/reference/profileInformationIndex-1.png index 2c72b333e..6e03eb048 100644 Binary files a/reference/profileInformationIndex-1.png and b/reference/profileInformationIndex-1.png differ diff --git a/reference/profileInformationIndex.html b/reference/profileInformationIndex.html index 9637684c9..4bf699f08 100644 --- a/reference/profileInformationIndex.html +++ b/reference/profileInformationIndex.html @@ -1,5 +1,5 @@ -Soil Profile Information Index — profileInformationIndex • aqpSoil Profile Information Index — profileInformationIndex • aqp @@ -68,17 +68,18 @@

Soil Profile Information Index

-

A simple index of "information" content associated with individuals in a SoilProfileCollection object. Information content is quantified by number of bytes after gzip compression via memCompress().

+

A simple index of "information" content associated with individuals in a SoilProfileCollection object. Information content is quantified by number of bytes after compression via memCompress().

profileInformationIndex(
   x,
   vars,
-  method = c("median", "mean", "sum"),
+  method = c("sum", "mean", "median"),
   baseline = TRUE,
-  useDepths = TRUE,
-  numericDigits = 4
+  numericDigits = 8,
+  removeNA = FALSE,
+  padNA = TRUE
 )
@@ -100,13 +101,17 @@

Arguments

logical, compute ratio to "baseline" information content, see details

-
useDepths
-

logical, include horizon depths in vars

- -
numericDigits

integer, number of significant digits to retain in numeric -> character conversion

+ +
removeNA
+

remove NA before compression

+ + +
padNA
+

pad all profiles with NA to deepest lower depth in x (max(x))

+

Value

@@ -128,43 +133,57 @@

Author

Examples


-# simulate three profiles of increasing complexity
-p1 <- data.frame(id = 1, top = 0, bottom = 100, p = 5)
+# single horizon, constant value
+p1 <- data.frame(id = 1, top = 0, bottom = 100, p = 5, name = 'H')
 
+# multiple horizons, constant value
 p2 <- data.frame(
-id = 2, top = c(0, 10, 20, 30, 40, 50), 
-bottom = c(10, 20, 30, 40, 50, 100), 
-p = rep(5, times = 6)
+  id = 2, top = c(0, 10, 20, 30, 40, 50),
+  bottom = c(10, 20, 30, 40, 50, 100),
+  p = rep(5, times = 6),
+  name = c('A1', 'A2', 'Bw', 'Bt1', 'Bt2', 'C')
 )
 
+# multiple horizons, random values
 p3 <- data.frame(
-id = 3, top = c(0, 10, 20, 30, 40, 50), 
-bottom = c(10, 20, 30, 40, 50, 100), 
-p = c(1, 5, 10, 3, 6, 2)
+  id = 3, top = c(0, 10, 20, 30, 40, 50),
+  bottom = c(10, 20, 30, 40, 50, 100),
+  p = c(1, 5, 10, 35, 6, 2),
+  name = c('A1', 'A2', 'Bw', 'Bt1', 'Bt2', 'C')
 )
 
+# multiple horizons, mostly NA
+p4 <- data.frame(
+  id = 4, top = c(0, 10, 20, 30, 40, 50),
+  bottom = c(10, 20, 30, 40, 50, 100),
+  p = c(1, NA, NA, NA, NA, NA),
+  name = c('A1', 'A2', 'Bw', 'Bt1', 'Bt2', 'C')
+)
+
+# shallower version of p1
+p5 <- data.frame(id = 5, top = 0, bottom = 50, p = 5, name = 'H')
+
 # combine and upgrade to SPC
-z <- rbind(p1, p2, p3)
+z <- rbind(p1, p2, p3, p4, p5)
 depths(z) <- id ~ top + bottom
+hzdesgnname(z) <- 'name'
+
+z <- fillHzGaps(z)
 
 # visual check
-plotSPC(z, color = 'p')
-
+par(mar = c(1, 0, 3, 3))
+plotSPC(z, color = 'p', name.style = 'center-center', cex.names = 0.8, max.depth = 110)
+
+# factor version of horizon name
+z$fname <- factor(z$name)
 
-# compute information index several ways
-profileInformationIndex(z, vars = c('p'), method = 'sum')
-#>        1        2        3 
-#> 3.000000 4.375566 4.804137 
-profileInformationIndex(z, vars = c('p'), method = 'mean')
-#>         1         2         3 
-#> 0.0000000 0.4585219 0.6013790 
+vars <- c('p', 'name')
+# result is total bytes
+pi <- profileInformationIndex(z, vars = vars, method = 'sum', baseline = FALSE)
 
-profileInformationIndex(z, vars = c('p'), method = 'mean', baseline = FALSE)
-#>         1         2         3 
-#>  8.666667 19.666667 22.333333 
-profileInformationIndex(z, vars = c('p'), method = 'sum', baseline = FALSE)
-#>  1  2  3 
-#> 29 62 70 
+text(x = 1:5, y = 105, labels = pi, cex = 0.85)
+mtext('Profile Information Index (bytes)', side = 1, line = -1)
+
 
 
diff --git a/reference/singlebracket.html b/reference/singlebracket.html index 8d5f6f76b..e271a0b70 100644 --- a/reference/singlebracket.html +++ b/reference/singlebracket.html @@ -1,5 +1,5 @@ -Matrix/data.frame-like access to profiles and horizons in a SoilProfileCollection — [,SoilProfileCollection,ANY,ANY,ANY-method • aqpMatrix/data.frame-like access to profiles and horizons in a SoilProfileCollection — [,SoilProfileCollection-method • aqp -
# S4 method for SoilProfileCollection,ANY,ANY,ANY
+    
# S4 method for SoilProfileCollection
 [(x, i, j, ..., drop = TRUE)