diff --git a/articles/Introduction-to-SoilProfileCollection-Objects.html b/articles/Introduction-to-SoilProfileCollection-Objects.html index 5fb655b8..07ea4c58 100644 --- a/articles/Introduction-to-SoilProfileCollection-Objects.html +++ b/articles/Introduction-to-SoilProfileCollection-Objects.html @@ -258,7 +258,6 @@

Rapid Templating hz.depths = TRUE )

-
#> [1] 0.1223958
@@ -362,7 +361,7 @@

Horizon and Site Data

Assignment of new data to existing or new attributes can proceed as follows.

-
+
 
#>  [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]  789.9935 1038.2976  634.4105  999.1643 1093.2329 1172.2617  726.7274  962.9012  963.3701
 #> [10]  957.5942
-
+
 # unit-length value explicitly targeting site data
 site(sp4)$collection_id <- 1
 
@@ -394,7 +393,7 @@ 

Horizon and Site DataSoilProfileCollection.

-
+
 # extract horizon data to data.frame
 h <- horizons(sp4)
 
@@ -457,7 +456,7 @@ 

Diagnostic Horizons
+
 dh <- data.frame(
   id = 'colusa',
   kind = 'argillic',
@@ -497,7 +496,7 @@ 

Root Restrictive FeaturesThe example data sp4 does not describe the restrictive features, so we will simulate some at the bottom of each profile + 20cm.

-
+
 # get the depth of each profile
 rf.top <- profileApply(sp4, max)
 rf.bottom <- rf.top + 20
@@ -536,7 +535,7 @@ 

Object Metadata

SoilProfileCollection metadata can be extracted and set using the metadata() and metadata<- methods.

-
+
 # metadata structure
 str(metadata(sp4))
#> List of 6
@@ -546,7 +545,7 @@ 

Object Metadata#> $ aqp_hztexcl : chr "" #> $ depth_units : chr "cm" #> $ stringsAsFactors: logi FALSE

-
+
 # alter the depth unit metadata attribute
 depth_units(sp4) <- 'inches' # units are really 'cm'
 
@@ -567,7 +566,7 @@ 

Object Metadata#> $ describer : chr "DGM" #> $ date : Date[1:1], format: "2009-01-01" #> $ citation : chr "McGahan, D.G., Southard, R.J, Claassen, V.P. 2009. Plant-Available Calcium Varies Widely in Soils on Serpentini"| __truncated__

- @@ -582,7 +581,7 @@

Spatial Data
+
 # generate some fake coordinates as site level attributes
 sp4$x <- rnorm(n = length(sp4), mean = 354000, sd = 100)
 sp4$y <- rnorm(n = length(sp4), mean = 4109533, sd = 100)
@@ -603,14 +602,14 @@ 

Spatial Data#> [8,] 354057.8 4109801 #> [9,] 354011.8 4109497 #> [10,] 353808.8 4109554

-
+
 # get/set spatial reference system using prj()<-
 prj(sp4) <- '+proj=utm +zone=11 +datum=NAD83'
 
 # return CRS information
 prj(sp4)
#> [1] "+proj=utm +zone=11 +datum=NAD83"
-
+
 # extract spatial data + site level attributes in new spatial object
 sp4.sp <- as(sp4, 'SpatialPointsDataFrame')
 sp4.sf <- as(sp4, 'sf')
@@ -630,12 +629,12 @@

Validity and Horizon Logichttps://github.com/ncss-tech/aqp/issues

checkSPC() returns TRUE for a SoilProfileCollection that contains all slots defined in the class prototype.

-
+
 checkSPC(sp4)

spc_in_sync() is used as the validity method for the SoilProfileCollection, it determines if some reordering of the horizon data relative to the unique profile ID / site order has occurred.

-
+
 
#>   nSites relativeOrder valid
 #> 1   TRUE          TRUE  TRUE
@@ -643,7 +642,7 @@

Validity and Horizon Logic -
+
 

checkHzDepthLogic() has the ability to perform logical tests on whole profiles or individual horizons. Four different tests are @@ -654,7 +653,7 @@

Validity and Horizon Logic

missing (NA) top or bottom depth

  • gap or overlap between adjacent horizons

  • -
    +
     
    #>                id valid depthLogic sameDepth missingDepth overlapOrGap
     #> 1          colusa  TRUE      FALSE     FALSE        FALSE        FALSE
    @@ -667,7 +666,7 @@ 

    Validity and Horizon Logic#> 8 shasta TRUE FALSE FALSE FALSE FALSE #> 9 shasta-trinity TRUE FALSE FALSE FALSE FALSE #> 10 tehama TRUE FALSE FALSE FALSE FALSE

    -
    +
     checkHzDepthLogic(sp4, byhz = TRUE)
    #>                id top bottom valid hzID depthLogic sameDepth missingDepth overlapOrGap
     #> 1          colusa   0      3  TRUE    1      FALSE     FALSE        FALSE           NA
    @@ -708,7 +707,7 @@ 

    Coerciondata.frame, list and SpatialPointsDataFrame (when spatial slot has been set up):

    -
    +
     # check our work by viewing the internal structure
     str(sp4)
     
    @@ -744,7 +743,7 @@ 

    ProfilesUsing the i index, select one or more profiles by numeric index. An index greater than the number of profiles will return an empty SoilProfileCollection object.

    -
    +
     # explicit string matching
     idx <- which(sp4$group == 'A')
     
    @@ -758,7 +757,7 @@ 

    Profilessp4[idx, ]

    In an interactive session, it is often simpler to use subset() directly:

    -
    +
     subset(sp4, group == 'A')
     subset(sp4, elevation < 1000)
     subset(sp4, grepl('shasta', id, ignore.case = TRUE))
    @@ -769,7 +768,7 @@

    Horizons by Index
    +
     sp4[, 2]

    @@ -794,7 +793,7 @@

    Splitting, Dupli SoilProfileCollection. Manually subset the example data into 3 pieces, compile into a list, and then combine back together.

    -
    +
     # subset data into chunks
     s1 <- sp4[1:2, ]
     s2 <- sp4[4, ]
    @@ -809,7 +808,7 @@ 

    Splitting, Dupli with different internal structure. The final object will contain the all site and horizon columns from the inputs, possibly creating sparse tables. IDs and horizon depth names are taken from the first object.

    -
    +
     # sample data as data.frame objects
     data(sp1)
     data(sp3)
    @@ -854,7 +853,7 @@ 

    Splittingcombine() is split(): subsets of the SoilProfileCollection are split into list elements, each containing a new SoilProfileCollection.

    -
    +
     # continuing from above
     # split subsets of x into a list of SoilProfileCollection objects using site-level attribute 'g'
     res <- split(x, 'g')
    @@ -866,17 +865,16 @@ 

    Duplication
    +
     d <- duplicate(sp4[1, ], times = 8)
     par(mar = c(0, 2, 0, 1))
     plotSPC(d, color = 'ex_Ca_to_Mg')

    -
    #> [1] 0.5067568

    Selecting Unique Profiles

    -
    +
     # an example soil profile  
     x <- data.frame(
       id = 'A',
    @@ -908,19 +906,16 @@ 

    Selecting Unique Profiles name.style = 'center-center', width = 0.15)

    -
    #> [1] 0.03216912
    -
    +
     # "uniqueness" is a function of variables selected to consider
     plotSPC(unique(x.sim, vars = c('top', 'bottom')),
             name.style = 'center-center')

    -
    #> [1] 0.1617973
    -
    +
     plotSPC(unique(x.sim, vars = c('name')),
             name.style = 'center-center',
             width = 0.15)

    -
    #> [1] 0.03235947
    @@ -954,39 +949,39 @@

    Making AdjustmentsexplainPlotSPC() function is helpful for adjusting some of the more obscure arguments to plotSPC().

    A basic plot with debugging information overlaid:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name')

    Make sketches wider:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', width = 0.3)

    Move soil surface at 0cm “down” 5cm:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', y.offset = 5)

    Move soil surface at 0cm “up” 10cm; useful for sketches of shallow profiles:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', y.offset = -10)

    Scale depths by 50%:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', scaling.factor = 0.5)

    A graphical explanation of how profiles are re-arranged via plot.order argument:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', plot.order = length(sp4):1)

    Leave room for an additional 2 profile sketches:

    -
    +
     par(mar = c(4, 3, 2, 2))
     explainPlotSPC(sp4, name = 'name', n = length(sp4) + 2)

    @@ -1009,30 +1004,27 @@

    Small SoilProfileCollections
    +
     data(osd)
     x <- osd

    Using 5x6 inch output device:

    -
    +
     par(mar = c(0, 2, 0, 4), xpd = NA)
     plotSPC(x[1, ], cex.names = 1)

    -
    #> [1] 0.2330044

    Using 7x6 inch output device, slight adjustments to width usually required:

    -
    +
     # set margins and turn off clipping
     par(mar = c(0, 2, 0, 4), xpd = NA)
     plotSPC(x[1:2, ], cex.names = 1, width = 0.25)

    -
    #> [1] 0.3259698

    Using 8x6 inch output device, slight adjustments to are usually required:

    -
    +
     par(mar = c(0, 2, 0, 4), xpd = NA)
     plotSPC(x, cex.names = 1, depth.axis = list(line = -0.1), width = 0.3)

    -
    #> [1] 0.3661152
    @@ -1040,7 +1032,7 @@

    Horizon Depth Labeling

    Horizon depths can be labeled for each profile as an alternative to a single depth axis.

    -
    +
     par(mar = c(0, 0, 1, 1))
     plotSPC(
       x,
    @@ -1052,7 +1044,6 @@ 

    Horizon Depth Labeling hz.depths.offset = 0.08 )

    -
    #> [1] 0.3191774

    As of aqp version 1.41, it is possible to “fix” overlapping horizon depth labels with the new fixLabelCollisions argument. This approach to labeling depths works best when moving horizon designations @@ -1069,7 +1060,7 @@

    Relative Horizontal Positioningplot.order but be careful: relative.pos must be specified in the final ordering of profiles. See ?plotSPC for details.

    -
    +
     par(mar = c(4, 3, 2, 2))
     pos <- jitter(1:length(sp4))
     explainPlotSPC(sp4, name = 'name', relative.pos = pos)
    @@ -1077,7 +1068,7 @@

    Relative Horizontal PositioningRelative positioning works well when the vector of positions is close to the default spacing along an integer sequence, but not when positions are closer than the width of a profile sketch.

    -
    +
     par(mar = c(4, 3, 2, 2))
     pos <- c(1, 1.2, 3, 4, 5, 5.2, 7, 8, 9, 10)
     explainPlotSPC(sp4, name = 'name', relative.pos = pos)
    @@ -1089,7 +1080,7 @@

    Relative Horizontal Positioningset.seed().

    -
    +
     par(mar = c(4, 3, 2, 2))
     new.pos <- fixOverlap(pos)
     explainPlotSPC(sp4, name = 'name', relative.pos = new.pos)
    @@ -1097,7 +1088,7 @@

    Relative Horizontal PositioningThere are several parameters available for optimizing horizontal position in the presence of overlap. See ?fixOverlap for details and further examples.

    -
    +
     par(mar = c(4, 3, 2, 2))
     new.pos <- fixOverlap(pos, thresh = 0.7)
     explainPlotSPC(sp4, name = 'name', relative.pos = new.pos)
    @@ -1110,16 +1101,15 @@

    Thematic Sketches
    +
     par(mar = c(0, 0, 3, 0))
     plotSPC(sp4,
             name = 'name',
             color = 'clay',
             col.label = 'Clay Content (%)')

    -
    #> [1] 0.4882812

    Use a different set of colors:

    -
    +
     par(mar = c(0, 0, 3, 0)) 
     plotSPC(
       sp4,
    @@ -1129,11 +1119,10 @@ 

    Thematic Sketches= 'Clay Content (%)' )

    -
    #> [1] 0.4882812

    Categorical properties can also be used to make a thematic sketch. Colors are interpolated when there are more classes than colors provided by col.palette:

    -
    +
     par(mar = c(0, 0, 3, 0))
     plotSPC(
       sp4,
    @@ -1143,10 +1132,9 @@ 

    Thematic Sketches= 'Original Horizon Name' )

    -
    #> [1] 0.4882812

    Try with generalized horizon labels:

    -
    +
     par(mar = c(0, 0, 3, 0)) 
     
     # generalize horizon names into 3 groups
    @@ -1160,21 +1148,19 @@ 

    Thematic Sketches= 'Generalized Horizon Name' )

    -
    #> [1] 0.4882812

    Horizon-level attributes that represent a volume fraction (e.g. coarse-fragment percentage) can be added to an existing figure. See ?addVolumeFraction for adding layers to an existing plot based on these attributes.

    -
    +
     par(mar = c(0, 0, 3, 0)) 
     # convert coarse rock fragment proportion to percentage
     sp4$frag_pct <- sp4$CF * 100
     
     # label horizons with fragment percent
    -plotSPC(sp4, name = 'frag_pct', color = 'frag_pct')
    -
    #> [1] 0.4882812
    -
    -# symbolize volume fraction data
    +plotSPC(sp4, name = 'frag_pct', color = 'frag_pct')
    +
    +# symbolize volume fraction data
     addVolumeFraction(sp4, colname = 'frag_pct')

    @@ -1185,7 +1171,7 @@

    Depth IntervalsdepthOf() function. See ?depthOf for more details.

    -
    +
     # extract top/bottom depths associated with all A horizons
     tops <- minDepthOf(sp4, pattern = '^A', hzdesgn = 'name', top = TRUE)
     bottoms <- maxDepthOf(sp4, pattern = '^A', hzdesgn = 'name', top = FALSE)
    @@ -1208,21 +1194,19 @@ 

    Depth Intervals#> 8 shasta 0 3 #> 9 shasta-trinity 0 12 #> 10 tehama 0 3

    -
    +
     par(mar = c(0, 0, 0, 0))
    -plotSPC(sp4)
    -
    #> [1] 0.4882812
    -
    -# annotate A horizon depth interval with brackets
    +plotSPC(sp4)
    +
    +# annotate A horizon depth interval with brackets
     addBracket(a, col = 'red', offset = -0.4)

    Add labels:

    -
    +
     par(mar = c(0, 0, 0, 0))
    -plotSPC(sp4, name = 'name')
    -
    #> [1] 0.4882812
    -
    -# addBracket() looks for a column `label`; add a ID for each bracket
    +plotSPC(sp4, name = 'name')
    +
    +# addBracket() looks for a column `label`; add a ID for each bracket
     a$label <- site(sp4)$id
     
     # note that depth brackets "knows which profiles to use" via profile ID
    @@ -1236,38 +1220,30 @@ 

    Depth Intervals

    It is possible to arrange profile sketches by site-level grouping variable:

    -
    +
     par(mar = c(0, 0, 0, 0)) 
    -groupedProfilePlot(sp4, groups = 'group')
    -
    #> [1] 0.4882812
    -
    -addBracket(a, col = 'red', offset = -0.4)
    +groupedProfilePlot(sp4, groups = 'group') +addBracket(a, col = 'red', offset = -0.4)

    There need not be brackets for all profiles in a collection:

    -
    +
     par(mar = c(0, 0, 0, 0))
     a.sub <- a[1:4,]
    -groupedProfilePlot(sp4, groups = 'group')
    -
    #> [1] 0.4882812
    -
    -addBracket(a.sub, col = 'red', offset = -0.4)
    +groupedProfilePlot(sp4, groups = 'group') +addBracket(a.sub, col = 'red', offset = -0.4)

    When bottom depths are missing an arrow is used:

    -
    +
     a$bottom <- NA
     par(mar = c(0, 0, 0, 0))
    -groupedProfilePlot(sp4, groups = 'group')
    -
    #> [1] 0.4882812
    -
    -addBracket(a, col = 'red', offset = -0.4)
    +groupedProfilePlot(sp4, groups = 'group') +addBracket(a, col = 'red', offset = -0.4)

    Manually define bottom depth:

    -
    +
     par(mar = c(0, 0, 0, 0))
    -groupedProfilePlot(sp4, groups = 'group')
    -
    #> [1] 0.4882812
    -
    -addBracket(
    +groupedProfilePlot(sp4, groups = 'group')
    +addBracket(
       a,
       col = 'red',
       label.cex = 0.75,
    @@ -1276,12 +1252,11 @@ 

    Depth Intervals)

    Further customization of brackets:

    -
    +
     par(mar = c(0, 0, 0, 0))
    -plotSPC(sp4, max.depth = 75)
    -
    #> [1] 0.4882812
    -
    -# copy root-restricting features
    +plotSPC(sp4, max.depth = 75)
    +
    +# copy root-restricting features
     a <- restrictions(sp4)
     
     # add a label: restrictive feature 'kind'
    @@ -1314,7 +1289,7 @@ 

    SVG Output for Use in Page Layo with most software titles. WMF output is compatible with MS Office tools and can be written with the win.metafile() function.

    -
    +
     # library(svglite)
     # svglite(filename = 'e:/temp/fig.svg', width = 7, height = 6, pointsize = 12)
     # 
    @@ -1334,7 +1309,7 @@ 

    Iterating Over Profiles in a Co for each profile in the collection, typically returning a single value per profile. In this case, the ordering of the results would match the ordering of values in the site level attribute table.

    -
    +
     # max() returns the depth of a soil profile
     sp4$soil.depth <- profileApply(sp4, FUN = max)
     
    @@ -1354,7 +1329,7 @@ 

    Iterating Over Profiles in a Co to create new horizon-level attributes. For example, the change in clay content by horizon depth (delta.clay, below) could be calculated as:

    -
    +
     # save as horizon-level attribute
     sp4$delta.clay <- profileApply(sp4, FUN = function(i) c(NA, diff(i$clay)))
     
    @@ -1377,7 +1352,7 @@ 

    Iterating Over Profiles in a Co custom function can be combined into a single SoilProfileCollection object via combine().

    -
    +
     # compute hz-thickness weighted mean exchangeable-Ca:Mg
     wt.mean.ca.mg <- function(i) {
       # use horizon thickness as a weight
    @@ -1394,7 +1369,7 @@ 

    Iterating Over Profiles in a Co

    In this case profiles are ordered based on the horizon-thickness weighted mean, exchangeable Ca:Mg values. Horizons are colored by exchangeable Ca:Mg values.

    -
    +
     # plot the data using our new order based on Ca:Mg weighted average
     # the result is an index of rank 
     new.order <- order(sp4$wt.mean.ca.to.mg)
    @@ -1403,10 +1378,9 @@ 

    Iterating Over Profiles in a Co plotSPC(sp4, name = 'name', color = 'ex_Ca_to_Mg', - plot.order = new.order)

    -
    #> [1] 0.4882812
    -
    -# add an axis labeled with the sorting criteria
    +        plot.order = new.order)
    +
    +# add an axis labeled with the sorting criteria
     axis(1, at = 1:length(sp4), labels = round(sp4$wt.mean.ca.to.mg, 3), cex.axis = 0.75)
     mtext(1, line = 2.25, text = 'Horizon Thickness Weighted Mean Ex. Ca:Mg', cex = 0.75)

    @@ -1421,7 +1395,7 @@

    Slicing Horizons: dice()dice() function. The slicing structure and variables of interest are defined via formula notation:

    -
    +
     # slice select horizon-level attributes
     seq ~ var.1 + var.2 + var.3 + ...
     # slice all horizon-level attributes
    @@ -1435,7 +1409,7 @@ 

    Slicing Horizons: dice()
    +
     # resample to 1cm slices
     s <- dice(sp4, fm = 0:15 ~ sand + silt + clay + name + ex_Ca_to_Mg)
     
    @@ -1444,15 +1418,14 @@ 

    Slicing Horizons: dice()#> [1] "SoilProfileCollection" #> attr(,"package") #> [1] "aqp"

    -
    +
     # plot sliced data
     par(mar = c(0, 0, 3, 0)) # tighten figure margins
     plotSPC(s, color = 'ex_Ca_to_Mg')

    -
    #> [1] 0.4882812

    Once soil profile data have been sliced, it is simple to extract “chunks” of data by depth interval via [-subsetting:

    -
    +
     # slice from 0 to max depth in the collection
     s <- dice(sp4, fm= 0:max(sp4) ~ sand + silt + clay + name + ex_Ca_to_Mg)
     
    @@ -1469,43 +1442,39 @@ 

    Slicing Horizons: dice()Ragged Extraction: glom()

    Select all horizons that overlap the interval of 5-15cm:

    -
    +
     # truncate to the interval 5-15cm
     clods <- glom(sp4, z1 = 5, z2 = 15)
     
     # plot outlines of original profiles
     par(mar = c(0, 0, 3, 1.5)) 
    -plotSPC(sp4, color = NA, name = NA, print.id = FALSE, depth.axis = FALSE, lwd = 0.5)
    -
    #> [1] 0.5073052
    -
    -# overlay glom() depth criteria
    +plotSPC(sp4, color = NA, name = NA, print.id = FALSE, depth.axis = FALSE, lwd = 0.5)
    +
    +# overlay glom() depth criteria
     rect(xleft = 0.5, ybottom = 15, xright = length(sp4) + 0.5, ytop = 5, lty = 2)
     
     # add SoilProfileCollection with selected horizons
     plotSPC(clods, add = TRUE, cex.names = 0.6, name = 'name', color = 'ex_Ca_to_Mg', name.style = 'center-center')

    -
    #> [1] 0.5999729

    Truncation: trunc()

    Truncate the SPC to the interval of 5-15cm:

    -
    +
     # truncate to the interval 5-15cm
     sp4.truncated <- trunc(sp4, 5, 15)
     
     # plot outlines of original profiles
     par(mar = c(0, 0, 3, 1.5)) 
    -plotSPC(sp4, color = NA, name = NA, print.id = FALSE, lwd = 0.5)
    -
    #> [1] 0.5073052
    -
    -# overlay truncation criteria
    +plotSPC(sp4, color = NA, name = NA, print.id = FALSE, lwd = 0.5)
    +
    +# overlay truncation criteria
     rect(xleft = 0.5, ybottom = 15, xright = length(sp4) + 0.5, ytop = 5, lty = 2)
     
     # add truncated SoilProfileCollection
     plotSPC(sp4.truncated, depth.axis = FALSE, add = TRUE, cex.names = 0.6, name = 'name', color = 'ex_Ca_to_Mg', name.style = 'center-center')

    -
    #> [1] 0.5999729

    Change of Support @@ -1539,7 +1508,7 @@

    Aggregation over “slabs”c(0, 5, 10, 50, 100)): data are aggregated over the depths spanning 0–5, 5–10, 10–50, 50–100 units -
    +
     # aggregate a couple of the horizon-level attributes, 
     # across the entire collection, 
     # from 0--10 cm
    @@ -1555,7 +1524,7 @@ 

    Aggregation over “slabs”#> 1 sand 1 47.63 1 0 10 #> 2 silt 1 31.15 1 0 10 #> 3 clay 1 21.11 1 0 10

    -
    +
     # again, this time within groups defined by a site-level attribute:
     slab(
       sp4,
    @@ -1571,7 +1540,7 @@ 

    Aggregation over “slabs”#> 4 silt B 30.78 1 0 10 #> 5 clay A 20.30 1 0 10 #> 6 clay B 21.92 1 0 10

    -
    +
     # again, this time over several depth ranges
     slab(
       sp4,
    @@ -1590,7 +1559,7 @@ 

    Aggregation over “slabs”#> 7 clay 1 21.11000 1.0000000 0 10 #> 8 clay 1 28.10687 0.8733333 10 25 #> 9 clay 1 36.26966 0.5933333 25 40

    -
    +
     # again, this time along 1-cm slices, computing quantiles
     agg <- slab(sp4, fm = ~ Mg + Ca + ex_Ca_to_Mg + CEC_7 + clay)
     
    @@ -1603,7 +1572,7 @@ 

    Aggregation over “slabs”#> 4 Mg 1 6.195 13.175 21.05 25.050 30.73 1 3 4 #> 5 Mg 1 6.195 13.175 21.05 25.050 30.73 1 4 5 #> 6 Mg 1 6.195 13.175 21.05 26.250 31.72 1 5 6

    -
    +
     # plot median +/i bounds defined by the 25th and 75th percentiles
     # this is lattice graphics, syntax is a little rough
     xyplot(top ~ p.q50 | variable, data = agg, ylab = 'Depth', 
    @@ -1624,7 +1593,7 @@ 

    Aggregation over “slabs”

    Depth-wise aggregation can be useful for visual evaluation of multivariate similarity among groups of profiles.

    -
    +
     # processing the "napa" and tehama profiles
     idx <- which(profile_id(sp4) %in% c('napa', 'tehama'))
     napa.and.tehama <- slab(sp4[idx,], fm = ~ Mg + Ca + ex_Ca_to_Mg + CEC_7 + clay)
    @@ -1658,7 +1627,7 @@ 

    Aggregation over “slabs”

    The following example is based on a set of 9 randomly generated profiles, re-aligned to the Global Soil Map (GSM) standard depths.

    -
    +
     library(data.table)
     library(RColorBrewer)
     
    @@ -1699,7 +1668,7 @@ 

    Aggregation over “slabs”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():

    -
    +
     # reshape to wide format
     # this scales to > 1 aggregated variables
     d.gsm.pedons <- data.table::dcast(
    @@ -1718,14 +1687,10 @@ 

    Aggregation over “slabs” # compare original and aggregated par(mar = c(1, 0, 3, 3), mfrow = c(2, 1)) -plotSPC(d, color = 'p1')

    -
    #> [1] 0.06138393
    -
    -mtext('original depths', side = 2, line = -1.5)
    -plotSPC(d.gsm.pedons, color = 'p1')
    -
    #> [1] 0.06138393
    -
    -mtext('GSM depths', side = 2, line = -1.5)
    +plotSPC(d, color = 'p1') +mtext('original depths', side = 2, line = -1.5) +plotSPC(d.gsm.pedons, color = 'p1') +mtext('GSM depths', side = 2, line = -1.5)

    Note that re-aligned data may not represent reality (and should therefore be used with caution) when the original soil depth is @@ -1733,7 +1698,7 @@

    Aggregation over “slabs”contributing_fraction metric returned by slab() can be useful for assessing how much real data were used to generate the new set of re-aligned data.

    -
    +
     # reshape to wide format
     d.gsm.pedons.2 <- data.table::dcast(
       data.table(d.gsm), 
    @@ -1746,10 +1711,8 @@ 

    Aggregation over “slabs” # compare original and aggregated par(mar = c(1, 0, 3, 3), mfrow = c(2, 1)) -plotSPC(d.gsm.pedons, name = '', color = 'p1')

    -
    #> [1] 0.06138393
    -
    -mtext('GSM depths', side = 2, line = -1.5)
    +plotSPC(d.gsm.pedons, name = '', color = 'p1')
    +mtext('GSM depths', side = 2, line = -1.5)
     
     plotSPC(
       d.gsm.pedons.2,
    @@ -1757,10 +1720,8 @@ 

    Aggregation over “slabs” color = 'p1', col.label = 'Contributing Fraction', col.palette = RColorBrewer::brewer.pal(10, 'Spectral') -)

    -
    #> [1] 0.06138393
    -
    -mtext('GSM depths', side = 2, line = -1.5)
    +) +mtext('GSM depths', side = 2, line = -1.5)

    @@ -1778,7 +1739,7 @@

    Pair-Wise Dissimilarity: NCSP()See the function manual page and this paper for details.

    -
    +
     library(cluster)
     library(sharpshootR)
     
    @@ -1805,7 +1766,7 @@ 

    Pair-Wise Dissimilarity: NCSP()#> shasta 17.2 13.6 8.7 17.6 17.6 34.8 23.3 #> shasta-trinity 6.4 16.9 22.3 9.6 17.0 30.9 28.3 23.3 #> tehama 30.1 23.9 29.2 28.6 20.8 9.0 15.3 32.7 29.2

    -
    +
     # visualize dissimilarity matrix via divisive hierarchical clustering
     d.diana <- diana(d)
     
    @@ -1825,7 +1786,6 @@ 

    Pair-Wise Dissimilarity: NCSP() depth.axis = FALSE )

    -
    #> [1] 0.5322917

    Some additional examples can be found in:

    -
    #> [1] 1.052334

    Subgroup level classification (encoded as an un-ordered factor) will be used as a site-level attribute for computing pair-wise distances. Quickly review the grouping structure with groupedProfilePlot().

    -
    +
     # encode as a factor for distance calculation
     z$subgroup <- factor(z$subgroup)
     
     par(mar = c(0, 0, 1, 1))
     groupedProfilePlot(z, groups = 'subgroup', group.name.offset = -10, break.style = 'arrow', group.line.lty = 1, group.line.lwd = 1)

    -
    #> [1] 1.052334

    Horizon designation, grouped into “generalized horizon labels” will be used as the horizon-level attribute for computing pair-wise distances. REGEX pattern matching is used to apply @@ -190,7 +188,7 @@

    A Simple Example -
    +
     # assign GHL
     z$genhz <- generalize.hz(
       z$hzname, new = c('A', 'E', 'Bt', 'C'), 
    @@ -201,13 +199,12 @@ 

    A Simple Examplepar(mar = c(0, 0, 3, 1)) groupedProfilePlot(z, groups = 'subgroup', group.name.offset = -10, break.style = 'arrow', group.line.lty = 1, group.line.lwd = 1, color = 'genhz')

    -
    #> [1] 1.052334

    Define weights and compute separately horizon and site level distance matrices. In this case, the site-level distances are give double the weight as the horizon-level distances. See the manual pages (?NCSP and ?compareSites) for additional arguments that can be used to further customize the comparison.

    -
    +
     # horizon-level distance matrix weight
     w1 <- 1
     # perform NCSP using only the GHL (ordered factors) to a depth of 185cm
    @@ -229,16 +226,15 @@ 

    A Simple Example -
    +
     # divisive hierarchical clustering
     h <- as.hclust(diana(D))
     
     # hang soil profile sketches from resulting dendrogram
     par(mar = c(1, 0, 0, 1))
    -plotProfileDendrogram(z, clust = h, scaling.factor = 0.0075, y.offset = 0.15, width = 0.33, color = 'genhz', name = NA)
    -
    #> [1] 1.052334
    -
    -# annotate dendorgram with subgroup classification
    +plotProfileDendrogram(z, clust = h, scaling.factor = 0.0075, y.offset = 0.15, width = 0.33, color = 'genhz', name = NA)
    +
    +# annotate dendorgram with subgroup classification
     # this handy function provided by the {ape} package
     tiplabels(pch = 15, col = c(2, 3)[z$subgroup], cex = 1.5, offset = 0.05)
     
    diff --git a/articles/label-placement.html b/articles/label-placement.html
    index 47b2608a..9f70fd2d 100644
    --- a/articles/label-placement.html
    +++ b/articles/label-placement.html
    @@ -118,7 +118,6 @@ 

    Introduction

    -
    #> [1] 0.2265625

    Version 2.0 of the {aqp} package provides two algorithms for avoiding overlapping annotation, available in plotSPC() for the adjustment of horizon depth annotation, and for general use via @@ -130,7 +129,7 @@

    Introduction
    +
     library(aqp)
     
     # soil profile template
    @@ -151,9 +150,8 @@ 

    Introduction# create 3 copies of each simulation s <- duplicate(s, times = 3)

    Overlapping horizon depth labels are clear. Note that there are three -copies of each simulated variation on the original template.

    -
    #> [1] 0.6210938
    -

    +copies of each simulated variation on the original template. +

    Selecting the optimal label-adjustment methods and parameters will depend on the collection of profiles, horizonation, profile height, font sizes, and graphics device settings (figure height, resolution).

    @@ -183,7 +181,6 @@

    Electrostatic SimulationelectroStatics_1D(). The most common adjustment is via charge density (q). See comparisons below.

    -
    #> [1] 0.6210938

    @@ -199,9 +196,8 @@

    Simulated AnnealingSANN_1D() via fixOverlap().

    Note that each solution, within duplicate profiles, is slightly -different.

    -
    #> [1] 0.6210938
    -

    +different. +

    @@ -209,7 +205,7 @@

    Quick Comparison

    Create a very busy profile with lots of possible overlapping horizon depth labels.

    -
    +
     x <- quickSPC(
       "SPC:Oi|Oe|AAA|E1|E2|E3|BhsBhsBhsBhs|Bt1|Bt2|Bt3Bt3|CCCCCC|Ab1|Ab2|2C2C2C2C2C2C|2Cr|2R2R2R2R2R2R2R2R", 
       interval = 1
    @@ -218,7 +214,7 @@ 

    Quick Comparisonx$z <- as.numeric(x$hzID)

    Set arguments to plotSPC() and define a custom function to demonstrate various label adjustment settings.

    -
    +
     # pretty colors
     .bluecolors <- hcl.colors(n = 25, palette = 'Blues')[-25]
     
    @@ -259,48 +255,32 @@ 

    Quick Comparisonset.seed().

    -
    +
     par(mar = c(1, 0, 0, 0), mfcol = c(1, 8))
     
    -testIt(x, fixLabelCollisions = FALSE)
    -
    #> [1] 0.4010417
    -
    -title('No\nAdjustment', line = -3.5, adj = 0.5)
    +testIt(x, fixLabelCollisions = FALSE)
    +title('No\nAdjustment', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'S'))
    -
    #> [1] 0.4010417
    -
    -title('SANN\nsim 1', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'S'))
    +title('SANN\nsim 1', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'S'))
    -
    #> [1] 0.4010417
    -
    -title('SANN\nsim 2', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'S'))
    +title('SANN\nsim 2', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'S'))
    -
    #> [1] 0.4010417
    -
    -title('SANN\nsim 3', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'S'))
    +title('SANN\nsim 3', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'E', q = 1.5))
    -
    #> [1] 0.4010417
    -
    -title('Electrostatic\nq = 1.5', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'E', q = 1.5))
    +title('Electrostatic\nq = 1.5', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'E', q = 1))
    -
    #> [1] 0.4010417
    -
    -title('Electrostatic\nq = 1', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'E', q = 1))
    +title('Electrostatic\nq = 1', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'E', q = 0.5))
    -
    #> [1] 0.4010417
    -
    -title('Electrostatic\nq = 0.5', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'E', q = 0.5))
    +title('Electrostatic\nq = 0.5', line = -3.5, adj = 0.5)
     
    -testIt(x, fixOverlapArgs = list(method = 'E', q = 0.25))
    -
    #> [1] 0.4010417
    -
    -title('Electrostatic\nq = 0.25', line = -3.5, adj = 0.5)
    +testIt(x, fixOverlapArgs = list(method = 'E', q = 0.25)) +title('Electrostatic\nq = 0.25', line = -3.5, adj = 0.5)

    @@ -383,7 +339,7 @@

    General CasesplotSPC(). The function overlapMetics() can be used to determine overlap within a vector of positions based on a given distance threshold.

    -
    +
     x <- c(1, 2, 3, 3.4, 3.5, 5, 6, 10)
     
     overlapMetrics(x, thresh = 0.5)
    @@ -398,7 +354,7 @@

    General CasesfixOverlap() for additional details.

    -
    +
     # vector of positions, typically labels but could be profile sketch alignment on the x-axis
     s <- c(1, 2, 2.3, 4, 5, 5.5, 7)
     
    @@ -408,7 +364,7 @@ 

    General Cases#> [1] 1.000000 2.198432 2.775781 4.000000 5.000000 5.500000 7.000000 #> attr(,"converged") #> [1] TRUE

    -
    +
    @@ -424,7 +380,7 @@ 

    Compare Algorithms
    +
     evalMethods <- function(x, thresh, q, ...) {
       
       cols <- hcl.colors(n = 9, palette = 'Zissou 1', rev = TRUE)
    @@ -483,7 +439,7 @@ 

    Compare Algorithms
    +
     

    -
    +
     # ok, but now most label positions are affected
     evalMethods(x, thresh = 5, q = 1.8)

    -
    +
     # too high, wasting time on more iterations
     evalMethods(x, thresh = 5, q = 3)

    -
    +
     # far too high, wasting more time with little gain
     evalMethods(x, thresh = 5, q = 4)

    -
    +
     # chaos and failure to converge
     evalMethods(x, thresh = 5, q = 5)

    Additional examples to tinker with.

    -
    +
     # threshold too large
     evalMethods(x, thresh = 10, q = 3)
     
    @@ -560,7 +516,7 @@ 

    Learning More about the SANN Alg

    Define a custom function for visualizing the extended output from fixOverlap(..., method = 'S', trace = TRUE).

    -
    +
     

    A relatively challenging example.

    -
    +
     x <- c(0, 1, 2, 2.2, 2.8, 3.5, 6, 8, 10, 10.1, 12.8, 13, 14.8, 15, 15.5)
     
     # fix overlap, return debugging information
     set.seed(10101)
     z <- fixOverlap(x, thresh = 0.73, method = 'S', trace = TRUE)
    #> 160 iterations
    -
    +
     # check convergence
     z$converged
    #> [1] TRUE
    -
    +
     # inspect algorithm trace
     tracePlot(x, z)

    -
    +
     # trace log
     # B: boundary condition violation
     # O: rank (order) violation
    @@ -647,7 +603,7 @@ 

    Learning More about the SANN Alg #> B O + - #> 22 71 64 2

    A very challenging example.

    -
    +
     # fix overlap, return debugging information
     set.seed(101010)
     x <- sort(runif(10, min = 2.5, max = 3.5))
    @@ -655,16 +611,16 @@ 

    Learning More about the SANN Alg # widen boundary conditions z <- fixOverlap(x, thresh = 0.2, trace = TRUE, min.x = 0, max.x = 10, maxIter = 2000, adj = 0.05)

    #> 1203 iterations
    -
    +
     # check convergence
     z$converged
    #> [1] TRUE
    -
    +
     # inspect algorithm trace
     tracePlot(x, z)

    Cleanup.

    -
    +
     # reset plotSPC() options
     options(.aqp.plotSPC.args = NULL)
    diff --git a/articles/missing-data.html b/articles/missing-data.html index f0f3ab5b..74cff3cc 100644 --- a/articles/missing-data.html +++ b/articles/missing-data.html @@ -117,20 +117,17 @@

    Missing Data

    plotSPC(jacobs2000, name.style = 'center-center', cex.names = 0.8, color = 'time_saturated')

    -
    #> [1] 0.3289879
    -
    +
     # missing some data
     plotSPC(jacobs2000, name.style = 'center-center', 
             cex.names = 0.8, color = 'concentration_color')

    -
    #> [1] 0.3289879
    -
    +
     # very nearly complete
     plotSPC(jacobs2000, name.style = 'center-center', 
             cex.names = 0.8, color = 'matrix_color')

    -
    #> [1] 0.3289879
    -
    +
     # variables to consider
     v <- c('time_saturated', 'concentration_color', 'matrix_color')
     
    @@ -166,8 +163,7 @@ 

    Missing Data

    cex.names = 0.8, color = 'hz.data.complete' )

    -
    #> [1] 0.3289879
    -
    +
     # rank on profile completeness
     new.order <- order(jacobs2000$data.complete)
     
    @@ -176,10 +172,9 @@ 

    Missing Data

    jacobs2000, name.style = 'center-center', cex.names = 0.8, color = 'hz.data.complete', plot.order = new.order -)
    -
    #> [1] 0.3289879
    -
    -# add relative completeness axis
    +)
    +
    +# add relative completeness axis
     # note re-ordering of axis labels
     axis(
       side = 1, at = 1:length(jacobs2000), 
    @@ -198,57 +193,47 @@ 

    Missing Data

    mtext('Relative\nCompleteness', side = 1, at = 0.25, line = 0.25, cex = 0.8) mtext('Absolute\nCompleteness (cm)', side = 1, at = 0.25, line = 2.75, cex = 0.8)

    -
    +
     x <- fetchKSSL(series = 'pierre')
     par(mar = c(0, 0, 3, 2))
     
     plotSPC(x, color = 'clay', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')

    -
    #> [1] 0.1507675
    -
    +
     plotSPC(x, color = 'cec7', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')

    -
    #> [1] 0.1507675
    -
    +
     plotSPC(x, color = 'estimated_oc', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')

    -
    #> [1] 0.1507675
    -
    +
     plotSPC(x, color = 'ph_h2o', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')

    -
    #> [1] 0.1507675
    -
    +
     plotSPC(x, color = 'db_13b', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')

    -
    #> [1] 0.1507675
    -
    +
     par(mar = c(1, 0, 3, 2))
    -plotSPC(x, color = 'ph_h2o', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')
    -
    #> [1] 0.1507675
    -
    -.b <- x[, , .LAST, .BOTTOM]
    +plotSPC(x, color = 'ph_h2o', width = 0.3, name.style = 'center-center', label = 'pedon_completeness_index')
    +
    +.b <- x[, , .LAST, .BOTTOM]
     text(x = 1:length(x), y = .b, labels = x$pi, cex = 0.85, pos = 1)
     mtext('Profile Information Index (bytes)', side = 1, line = -0.5)

    -
    +
     v <- c('clay', 'db_13b', 'cec7', 'ph_h2o')
     x$rel.not.missing <- evalMissingData(x, vars = v, method = 'relative')
     x$abs.not.missing <- evalMissingData(x, vars = v, method = 'absolute')
     x$hz.not.missing <- evalMissingData(x, vars = v, method = 'horizon')
     
     o <- order(x$rel.not.missing)
    -plotSPC(x, color = 'hz.not.missing', width = 0.33, name.style = 'center-center', label = 'pedon_completeness_index', plot.order = o)
    -
    #> [1] 0.1507675
    -
    -text(x = 1:length(x), y = .b[o], labels = round(x$rel.not.missing[o], 2), cex = 0.85, pos = 1)
    +plotSPC(x, color = 'hz.not.missing', width = 0.33, name.style = 'center-center', label = 'pedon_completeness_index', plot.order = o)
    +text(x = 1:length(x), y = .b[o], labels = round(x$rel.not.missing[o], 2), cex = 0.85, pos = 1)
     mtext('Relative Non-Missing Fraction', side = 1, line = -0.5)

    -
    +
     o <- order(x$abs.not.missing)
    -plotSPC(x, color = 'hz.not.missing', width = 0.33, name.style = 'center-center', label = 'pedon_completeness_index', plot.order = o)
    -
    #> [1] 0.1507675
    -
    -text(x = 1:length(x), y = .b[o], labels = x$abs.not.missing[o], cex = 0.85, pos = 1)
    +plotSPC(x, color = 'hz.not.missing', width = 0.33, name.style = 'center-center', label = 'pedon_completeness_index', plot.order = o)
    +text(x = 1:length(x), y = .b[o], labels = x$abs.not.missing[o], cex = 0.85, pos = 1)
     mtext('Absolute Non-Missing (cm)', side = 1, line = -0.5)

    diff --git a/pkgdown.yml b/pkgdown.yml index 3acab798..e1e76fe1 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -9,5 +9,5 @@ articles: Munsell-color-conversion: Munsell-color-conversion.html NCSP: NCSP.html new-in-aqp-2: new-in-aqp-2.html -last_built: 2024-06-15T01:02Z +last_built: 2024-06-25T19:40Z diff --git a/reference/SoilProfileCollection-class.html b/reference/SoilProfileCollection-class.html index 8d069952..3793e0ff 100644 --- a/reference/SoilProfileCollection-class.html +++ b/reference/SoilProfileCollection-class.html @@ -222,7 +222,6 @@

    Examples

    depths(d) <- id ~ top + bottom plot(d) -#> [1] 0.1407658 # split into new SoilProfileCollection objects by index d.1 <- d[1, ] @@ -234,7 +233,6 @@

    Examples

    d.new <- c(d.345, d.1, d.2) plot(d.new) -#> [1] 0.07678133 data(sp1) diff --git a/reference/SoilProfileCollection-plotting-methods.html b/reference/SoilProfileCollection-plotting-methods.html index 1cadf58d..46002520 100644 --- a/reference/SoilProfileCollection-plotting-methods.html +++ b/reference/SoilProfileCollection-plotting-methods.html @@ -428,13 +428,11 @@

    Examples

    # plot profiles without horizon-line divisions plotSPC(sp1, divide.hz = FALSE) -#> [1] 0.3799805 # diagonal lines encode horizon boundary distinctness sp1$hzD <- hzDistinctnessCodeToOffset(sp1$bound_distinct) plotSPC(sp1, hz.distinctness.offset = 'hzD', name.style = 'center-center') -#> [1] 0.3799805 # plot horizon color according to some property data(sp4) @@ -442,7 +440,6 @@

    Examples

    hzdesgnname(sp4) <- 'name' plotSPC(sp4, color = 'clay') -#> [1] 0.6817383 # another example data(sp2) @@ -455,13 +452,11 @@

    Examples

    plotSPC(sp2, label = 'surface', plot.order = order(sp2$surface), max.depth = 400) -#> [1] 2.074414 # example using a categorical attribute plotSPC(sp2, color = "plasticity", max.depth = 400) -#> [1] 0.9719401 # plot two SPC objects in the same figure par(mar = c(1,1,1,1)) @@ -469,12 +464,10 @@

    Examples

    # plot the first SPC object and # allocate space for the second SPC object plotSPC(sp1, n = length(sp1) + length(sp2)) -#> [1] 0.4042345 # plot the second SPC, starting from the first empty space plotSPC(sp2, x.idx.offset = length(sp1), add = TRUE) -#> [1] 1.033979 ## @@ -492,7 +485,6 @@

    Examples

    cex.names = 0.8 ) -#> [1] 0.4472448 # shrink horizon names in "thin" horizons plotSPC( @@ -504,7 +496,6 @@

    Examples

    cex.names = 0.8, ) -#> [1] 0.4472448 ## @@ -524,12 +515,10 @@

    Examples

    # note that the legend is split into 2 rows when length(classes) > n.legend argument plotSPC(sp3, color='fake.data', name='fake.data', cex.names=0.8) -#> [1] 0.1893726 # make enough room in a single legend row plotSPC(sp3, color='fake.data', name='fake.data', cex.names=0.8, n.legend=15) -#> [1] 0.1893726 ## @@ -552,12 +541,10 @@

    Examples

    # y-offset at 0 plotSPC(x, color = 'matrix_color', cex.names = 0.66) -#> [1] 0.3687043 # constant adjustment to y-offset plotSPC(x, color = 'matrix_color', cex.names = 0.66, y.offset = 50) -#> [1] 0.3687043 # attempt using invalid y.offset # warning issued and default value of '0' used @@ -577,7 +564,6 @@

    Examples

    fixLabelCollisions = TRUE, name.style = 'center-center' ) -#> [1] 0.3942057 #> depth axis is disabled when more than 1 unique y offsets are supplied @@ -598,7 +584,6 @@

    Examples

    hz.depths = TRUE, name.style = 'center-center' ) -#> [1] 0.346582 #> depth axis is disabled when more than 1 unique y offsets are supplied @@ -621,7 +606,6 @@

    Examples

    hz.depths = TRUE, name.style = 'center-center' ) -#> [1] 0.3573011 #> depth axis is disabled when more than 1 unique y offsets are supplied box() diff --git a/reference/accumulateDepths.html b/reference/accumulateDepths.html index ce1bee74..dfe425c5 100644 --- a/reference/accumulateDepths.html +++ b/reference/accumulateDepths.html @@ -172,7 +172,6 @@

    Examples

    hzdatum = 5 * 1:length(sp4)) plot(hz) -#> [1] 0.8375163 # example using old-style O horizons hz <- read.table(text = "peiidref hzdept hzdepb hzname seqnum phiid @@ -210,10 +209,8 @@

    Examples

    par(mfrow=c(2,1), mar=c(0,0,3,2)) plotSPC(origO, max.depth = 25) -#> [1] 0.07757092 plotSPC(fixedO, max.depth = 25) -#> [1] 0.07757092
    diff --git a/reference/addBracket.html b/reference/addBracket.html index dc786e3b..da97180e 100644 --- a/reference/addBracket.html +++ b/reference/addBracket.html @@ -155,7 +155,6 @@

    Examples

    par(mar = c(0, 0, 0, 1)) plotSPC(sp1, width = 0.3) -#> [1] 0.3917324 # extract min--max depths associated with all A horizons # result is a single-row data.frame / profile @@ -203,7 +202,6 @@

    Examples

    # plot in reverse order plotSPC(sp1, plot.order = rev(1:length(sp1)), width = 0.25) -#> [1] 0.3917324 # note that plotting order is derived from the call to `plotSPC(sp1)` addBracket(b1, col='red', offset = -0.35) @@ -211,7 +209,6 @@

    Examples

    # plot in reverse order plotSPC(sp1, plot.order = rev(1:length(sp1)), width = 0.25) -#> [1] 0.3917324 # note that plotting order is derived from the call to `plotSPC(sp1)` addBracket(b2, col='red', offset = -0.35) diff --git a/reference/alignTransect.html b/reference/alignTransect.html index d9ff1c9e..bbd6bd69 100644 --- a/reference/alignTransect.html +++ b/reference/alignTransect.html @@ -136,14 +136,12 @@

    Examples

    plotSPC(g, width=0.25, name.style='center-center', cex.names=0.75, relative.pos = g.p$relative.pos, plot.order = g.p$order) -#> [1] 0.7214442 axis(1, at = g.p$relative.pos, labels = g.p$grad, line = -1.5) plotSPC(a, width=0.25, name.style='center-center', cex.names=0.75, relative.pos = a.p$relative.pos, plot.order = a.p$order) -#> [1] 0.5329192 axis(1, at = a.p$relative.pos, labels = a.p$grad, line = -1.5) diff --git a/reference/allocate.html b/reference/allocate.html index 415ea04c..7e163439 100644 --- a/reference/allocate.html +++ b/reference/allocate.html @@ -226,7 +226,6 @@

    Examples

    plotSPC(sp3) -#> [1] 0.1407658 allocate( sp3, @@ -261,7 +260,6 @@

    Examples

    plotSPC(x) -#> [1] 0.1407658 allocate( x, diff --git a/reference/depthOf.html b/reference/depthOf.html index c86c8a88..155aa20b 100644 --- a/reference/depthOf.html +++ b/reference/depthOf.html @@ -88,7 +88,7 @@

    Get top or bottom depths of horizons matching a regular expression pattern pattern, FUN = NULL, top = TRUE, - hzdesgn = guessHzDesgnName(p), + hzdesgn = hzdesgnname(p, required = TRUE), no.contact.depth = NULL, no.contact.assigned = NA_real_, na.rm = TRUE, @@ -99,7 +99,7 @@

    Get top or bottom depths of horizons matching a regular expression pattern p, pattern, top = TRUE, - hzdesgn = guessHzDesgnName(p), + hzdesgn = hzdesgnname(p, required = TRUE), no.contact.depth = NULL, no.contact.assigned = NA, na.rm = TRUE, @@ -110,7 +110,7 @@

    Get top or bottom depths of horizons matching a regular expression pattern p, pattern, top = TRUE, - hzdesgn = guessHzDesgnName(p), + hzdesgn = hzdesgnname(p, required = TRUE), no.contact.depth = NULL, no.contact.assigned = NA, na.rm = TRUE, diff --git a/reference/depths.html b/reference/depths.html index 57fa08d7..8ec68374 100644 --- a/reference/depths.html +++ b/reference/depths.html @@ -194,7 +194,6 @@

    Examples

    # plot plot(sp1) -#> [1] 0.4668065 # number of profiles length(sp1) diff --git a/reference/duplicate.html b/reference/duplicate.html index b587bb88..60260d10 100644 --- a/reference/duplicate.html +++ b/reference/duplicate.html @@ -125,7 +125,6 @@

    Examples

    par(mar = c(0, 0, 3, 1)) plotSPC(d, color = 'Ca', width = 0.25) -#> [1] 1.963394
    diff --git a/reference/estimatePSCS.html b/reference/estimatePSCS.html index 384d6983..5f6a80de 100644 --- a/reference/estimatePSCS.html +++ b/reference/estimatePSCS.html @@ -87,9 +87,9 @@

    Estimate boundaries of the particle size control section (U.S Soil Taxonomy;
    estimatePSCS(
       p,
    -  hzdesgn = "hzname",
    -  clay.attr = "clay",
    -  texcl.attr = "texcl",
    +  hzdesgn = hzdesgnname(p, required = TRUE),
    +  clay.attr = hzmetaname(p, "clay", required = TRUE),
    +  texcl.attr = hztexclname(p, required = TRUE),
       tax_order_field = "tax_order",
       bottom.pattern = "Cr|R|Cd",
       simplify = TRUE,
    @@ -179,10 +179,13 @@ 

    Examples

    depths(sp1) <- id ~ top + bottom site(sp1) <- ~ group -p <- sp1 -attr <- 'prop' # clay contents -foo <- estimatePSCS(p, hzdesgn='name', clay.attr = attr, texcl.attr="texture") -foo +# set required metadata +hzdesgnname(sp1) <- 'name' +hztexclname(sp1) <- 'texture' +hzmetaname(sp1, 'clay') <- 'prop' + +x <- estimatePSCS(sp1) +x #> id pscs_top pscs_bottom #> 1 P001 49 89 #> 2 P002 30 59 @@ -193,8 +196,6 @@

    Examples

    #> 7 P007 25 100 #> 8 P008 27 102 #> 9 P009 28 103 - -

    diff --git a/reference/estimateSoilDepth.html b/reference/estimateSoilDepth.html index 311f5ee3..187f8343 100644 --- a/reference/estimateSoilDepth.html +++ b/reference/estimateSoilDepth.html @@ -166,7 +166,6 @@

    Examples

    par(mar = c(0, 0, 0, 2)) plotSPC(d, hz.depths = TRUE, name.style = 'center-center', cex.names = 1, width = 0.1) -#> [1] 0.02219775 # top of the first Cd estimateSoilDepth(d, name = 'name') @@ -212,7 +211,6 @@

    Examples

    par(mar=c(1,1,1,2)) # adjust default y-offset and depth scaling for following examples plotSPC(sp1, y.offset=10, scaling.factor=0.5) -#> [1] 0.417561 # get plotting parameters for profile widths and depth scaling factors lsp <- get("last_spc_plot", envir = aqp.env) diff --git a/reference/evalMissingData.html b/reference/evalMissingData.html index a45499b4..3eadbdc1 100644 --- a/reference/evalMissingData.html +++ b/reference/evalMissingData.html @@ -135,19 +135,16 @@

    Examples

    plotSPC(jacobs2000, name.style = 'center-center', cex.names = 0.8, color = 'time_saturated') -#> [1] 0.5164744 # missing some data plotSPC(jacobs2000, name.style = 'center-center', cex.names = 0.8, color = 'concentration_color') -#> [1] 0.5164744 # very nearly complete plotSPC(jacobs2000, name.style = 'center-center', cex.names = 0.8, color = 'matrix_color') -#> [1] 0.5164744 # variables to consider @@ -185,7 +182,6 @@

    Examples

    cex.names = 0.8, color = 'hz.data.complete' ) -#> [1] 0.5164744 # rank on profile completeness @@ -197,7 +193,6 @@

    Examples

    cex.names = 0.8, color = 'concentration_color', plot.order = new.order ) -#> [1] 0.5164744 # add relative completeness axis # note re-ordering of axis labels diff --git a/reference/fillHzGaps.html b/reference/fillHzGaps.html index 6c43a8dc..7bc71486 100644 --- a/reference/fillHzGaps.html +++ b/reference/fillHzGaps.html @@ -159,7 +159,6 @@

    Examples

    name = 'hzID', name.style = 'center-center', cex.names = 0.8, cex.id = 0.66) -#> [1] 0.7976646 # fill gaps left by HzDepthLogicSubset() z <- fillHzGaps(x, flag = TRUE) @@ -169,18 +168,15 @@

    Examples

    show.legend = FALSE, name.style = 'center-center', cex.names = 0.8, cex.id = 0.66) -#> [1] 0.7976646 # fill top to 0 cm z2 <- fillHzGaps(x, flag = TRUE, to_top = 0) plotSPC(z2, width = 0.3, color = '.filledGap', name = 'hzID', show.legend = FALSE) -#> [1] 0.7252535 # fill bottom to max(SPC) z3 <- fillHzGaps(x, flag = TRUE, to_top = 0, to_bottom = max(x)) plotSPC(z3, width = 0.3, color = '.filledGap', name = 'hzID', show.legend = FALSE) -#> [1] 0.7252535 ## another example data(sp4) @@ -200,10 +196,8 @@

    Examples

    #> filling gaps left by HzDepthLogicSubset plotSPC(d, color = 'Ca', show.legend = FALSE) -#> [1] 0.7252535 plotSPC(d, color = '.filledGap', show.legend = FALSE) -#> [1] 0.7252535
    diff --git a/reference/fixOverlap.html b/reference/fixOverlap.html index 4797f70f..03305fb6 100644 --- a/reference/fixOverlap.html +++ b/reference/fixOverlap.html @@ -184,27 +184,21 @@

    Examples

    op <- par(mar = c(0, 0, 0, 0), mfcol = c(1, 6)) testIt(x) -#> [1] 0.3894531 title('ES (defaults)', line = -3) testIt(x, fixOverlapArgs = list(method = 'S')) -#> [1] 0.3894531 title('SANN (defaults)', line = -3) testIt(x, fixOverlapArgs = list(method = 'E', q = 1.5)) -#> [1] 0.3894531 title('ES (q = 1.5)', line = -3) testIt(x, fixOverlapArgs = list(method = 'E', q = 1)) -#> [1] 0.3894531 title('ES (q = 1)', line = -3) testIt(x, fixOverlapArgs = list(method = 'E', q = 0.5)) -#> [1] 0.3894531 title('ES (q = 0.5)', line = -3) testIt(x, fixOverlapArgs = list(method = 'E', q = 0.1)) -#> [1] 0.3894531 title('ES (q = 0.1)', line = -3) diff --git a/reference/flagOverlappingHz.html b/reference/flagOverlappingHz.html index ab9e10f3..b878a1ff 100644 --- a/reference/flagOverlappingHz.html +++ b/reference/flagOverlappingHz.html @@ -131,7 +131,6 @@

    Examples

    plotSPC(z, color = '.overlapFlag', hz.depths = TRUE, depth.axis = FALSE, cex.names = 0.85) -#> [1] 0.06850334
    diff --git a/reference/getArgillicBounds.html b/reference/getArgillicBounds.html index 8696c08c..cf742446 100644 --- a/reference/getArgillicBounds.html +++ b/reference/getArgillicBounds.html @@ -85,9 +85,9 @@

    Estimate upper and lower boundary of argillic diagnostic subsurface horizon<
    getArgillicBounds(
       p,
    -  hzdesgn = "hzname",
    -  clay.attr = "clay",
    -  texcl.attr = "texcl",
    +  hzdesgn = hzdesgnname(p, required = TRUE),
    +  clay.attr = hzmetaname(p, "clay", required = TRUE),
    +  texcl.attr = hztexclname(p, required = TRUE),
       require_t = TRUE,
       bottom.pattern = "Cr|R|Cd",
       lower.grad.pattern = "^[2-9]*B*CB*[^rtd]*[1-9]*$",
    @@ -169,10 +169,13 @@ 

    Examples

    depths(sp1) <- id ~ top + bottom site(sp1) <- ~ group -p <- sp1 -attr <- 'prop' # clay contents -foo <- getArgillicBounds(p, hzdesgn='name', clay.attr = attr, texcl.attr="texture") -foo +# set required metadata +hzdesgnname(sp1) <- 'name' +hztexclname(sp1) <- 'texture' +hzmetaname(sp1, 'clay') <- 'prop' + +x <- getArgillicBounds(sp1) +x #> id ubound lbound #> 1 P001 49 89 #> 2 P002 NA NA diff --git a/reference/getCambicBounds.html b/reference/getCambicBounds.html index aeb27bdc..c8ab4d88 100644 --- a/reference/getCambicBounds.html +++ b/reference/getCambicBounds.html @@ -85,9 +85,9 @@

    Find all intervals that are potentially part of a Cambic horizon

    getCambicBounds(
       p,
    -  hzdesgn = guessHzDesgnName(p, required = TRUE),
    -  texcl.attr = guessHzTexClName(p, required = TRUE),
    -  clay.attr = guessHzAttrName(p, attr = "clay", c("total", "_r")),
    +  hzdesgn = hzdesgnname(p, required = TRUE),
    +  texcl.attr = hztexclname(p, required = TRUE),
    +  clay.attr = hzmetaname(p, "clay", required = TRUE),
       argi_bounds = NULL,
       d_value = "d_value",
       m_value = "m_value",
    @@ -165,12 +165,14 @@ 

    Examples

    # promote to SoilProfileCollection depths(spc) <- id ~ hzdept + hzdepb + +# set required metadata hzdesgnname(spc) <- 'hzname' hztexclname(spc) <- 'texcl' +hzmetaname(spc, 'clay') <- 'clay' # print results in table getCambicBounds(spc) -#> guessing horizon attribute 'clay' is stored in `clay` #> id cambic_top cambic_bottom cambic_index #> 1 1 32 49 1 diff --git a/reference/getSurfaceHorizonDepth.html b/reference/getSurfaceHorizonDepth.html index 26fdf878..112479d9 100644 --- a/reference/getSurfaceHorizonDepth.html +++ b/reference/getSurfaceHorizonDepth.html @@ -84,20 +84,20 @@

    Determine thickness of horizons (continuous from surface) matching a pattern
    getSurfaceHorizonDepth(
       p,
       pattern,
    -  hzdesgn = guessHzDesgnName(p),
    +  hzdesgn = hzdesgnname(p, required = TRUE),
       simplify = TRUE
     )
     
     getMineralSoilSurfaceDepth(
       p,
    -  hzdesgn = guessHzDesgnName(p),
    +  hzdesgn = hzdesgnname(p, required = TRUE),
       pattern = "O",
       simplify = TRUE
     )
     
     getPlowLayerDepth(
       p,
    -  hzdesgn = guessHzDesgnName(p),
    +  hzdesgn = hzdesgnname(p, required = TRUE),
       pattern = "^Ap[^b]*",
       simplify = TRUE
     )
    @@ -114,7 +114,7 @@

    Arguments

    hzdesgn
    -

    column name containing horizon designation. Default: guessHzDesgnName(p, required = TRUE).

    +

    column name containing horizon designation. Default: hzdesgnname(p, required = TRUE).

    simplify
    diff --git a/reference/glom.html b/reference/glom.html index f7cc46eb..30c07bc9 100644 --- a/reference/glom.html +++ b/reference/glom.html @@ -192,7 +192,6 @@

    Examples

    # inspect graphically par(mar = c(1,1,3,1)) plot(p, color = "prop", max.depth = 200) -#> [1] 1.215197 #> [P001:4] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() abline(h = c(25, 100), lty = 2) @@ -209,7 +208,6 @@

    Examples

    # inspect graphically par(mar = c(1,1,3,1)) plot(p2, color = "prop", max.depth = 200) -#> [1] 1.215197 #> [P001:4] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() abline(h = c(25, 100), lty = 2) @@ -226,7 +224,6 @@

    Examples

    # inspect graphically par(mar = c(1,1,3,1)) plot(p3, color = "prop", max.depth = 200) -#> [1] 1.215197 abline(h = c(25, 100), lty = 2) @@ -243,7 +240,6 @@

    Examples

    par(mar = c(1,1,3,1)) plot(p4, color = "prop", max.depth = 200) -#> [1] 1.215197 # load sample data @@ -259,12 +255,10 @@

    Examples

    # full profiles plot(sp3) -#> [1] 0.3444661 # trunc'd profiles plot(trunc(sp3, 0, 25)) -#> [1] 0.3444661
    diff --git a/reference/glomApply.html b/reference/glomApply.html index ead96188..1c95cd75 100644 --- a/reference/glomApply.html +++ b/reference/glomApply.html @@ -157,33 +157,27 @@

    Examples

    # constant depths, whole horizon returns by default plot(glomApply(sp3, function(p) c(25,100))) -#> [1] 0.4231771 # constant depths, truncated #(see aqp::trunc for helper function) plot(glomApply(sp3, function(p) c(25,30), truncate = TRUE)) -#> [1] 0.4231771 # constant depths, inverted plot(glomApply(sp3, function(p) c(25,100), invert = TRUE)) -#> [1] 0.4231771 # constant depths, inverted + truncated (same as above) plot(glomApply(sp3, function(p) c(25,30), invert = TRUE, truncate=TRUE)) -#> [1] 0.4231771 # random boundaries in each profile plot(glomApply(sp3, function(p) round(sort(runif(2, 0, max(sp3)))))) -#> [1] 0.3847064 # random boundaries in each profile (truncated) plot(glomApply(sp3, function(p) round(sort(runif(2, 0, max(sp3)))), truncate = TRUE)) -#> [1] 0.3847064 # calculate some boundaries as site level attribtes sp3$glom_top <- profileApply(sp3, getMineralSoilSurfaceDepth) @@ -195,7 +189,6 @@

    Examples

    # use site level attributes for glom intervals for each profile plot(glomApply(sp3, function(p) return(c(p$glom_top, p$glom_bottom)))) -#> [1] 0.4231771

    diff --git a/reference/guessHzAttrName.html b/reference/guessHzAttrName.html index 6d03e19b..c8c5ff6d 100644 --- a/reference/guessHzAttrName.html +++ b/reference/guessHzAttrName.html @@ -1,8 +1,8 @@ Guess Horizon Slot Column Names — guessHzAttrName • aqp @@ -82,8 +82,8 @@

    Guess Horizon Slot Column Names

    guessHzAttrName(): Guess the horizon column name where possible/preferred formative elements are known. There is a preference for records where more optional requirements are met to handle cases where there will be many matches. For example, working with soil data one might have "low, RV and high" total clay, as well as clay fractions. One could distinguish between these different measurements using standard formative elements for column names from the database of interest. Result is the first match in horizonNames(x) with the most required plus optional patterns matched.

    e.g. guessHzAttrName(x, attr="clay", optional=c("total", "_r")) matches (claytotal_r == totalclay_r) over (clay_r == claytotal == totalclay) over clay.

    -

    guessHzDesgnName(): This follows the historic convention used by aqp::plotSPC() looking for "hzname" or other column names containing the regular expression "name". If the pattern "name" is not found, the pattern "desgn" is searched as a fallback, as "hzdesgn" or "hz_desgn" are other common column naming schemes for horizon designation name.

    -

    guessHzTexClName(): This function is used to provide a texture class attribute column name to functions. It will use regular expressions to match "texcl" which is typically the texture of the fine earth fraction, without modifiers or in-lieu textures. Alternately, it will match "texture" for cases where "texcl" is absent (e.g. in NASIS Component Horizon).

    +

    guessHzDesgnName(): DEPRECATED This follows the historic convention used by aqp::plotSPC() looking for "hzname" or other column names containing the regular expression "name". If the pattern "name" is not found, the pattern "desgn" is searched as a fallback, as "hzdesgn" or "hz_desgn" are other common column naming schemes for horizon designation name.

    +

    guessHzTexClName(): DEPRECATED This function is used to provide a texture class attribute column name to functions. It will use regular expressions to match "texcl" which is typically the texture of the fine earth fraction, without modifiers or in-lieu textures. Alternately, it will match "texture" for cases where "texcl" is absent (e.g. in NASIS Component Horizon).

    @@ -101,15 +101,15 @@

    Arguments

    attr
    -

    A regular expression containing required formative element of attribute name.

    +

    character. A regular expression containing required formative element of attribute name.

    optional
    -

    A character vector of regular expression(s) containing optional formative elements of attribute name.

    +

    character. Vector of regular expression(s) containing optional formative elements of attribute name.

    verbose
    -

    A boolean value for whether to produce message output about guesses.

    +

    logical. Produce message output about guesses? Default: TRUE

    required
    @@ -160,28 +160,6 @@

    Examples

    #> guessing horizon attribute 'clay' is stored in `totalclay_r` #> [1] "totalclay_r" - -a <- data.frame(id = 1, top = c(0,10), bottom=c(10,40), horizonname=c("A","Bw")) -depths(a) <- id ~ top + bottom - -# store guess in metadata -hzdesgnname(a) <- guessHzDesgnName(a) - -# inspect result -hzdesgnname(a) -#> [1] "horizonname" - - -a <- data.frame(id = 1, top = c(0,10), bottom=c(10,40), texture=c("A","Bw")) -depths(a) <- id ~ top + bottom - -# store guess in metadata -hztexclname(a) <- guessHzTexClName(a) - -# inspect result -hztexclname(a) -#> [1] "texture" -
    diff --git a/reference/harden.melanization.html b/reference/harden.melanization.html index 43f7fdd0..8d084bf2 100644 --- a/reference/harden.melanization.html +++ b/reference/harden.melanization.html @@ -164,7 +164,6 @@

    Examples

    plot.order = jacobs2000$melanorder, max.depth = 250 ) -#> [1] 1.030629 segments( x0 = 0.5, diff --git a/reference/harden.rubification.html b/reference/harden.rubification.html index bfdb1c53..2aadb0ad 100644 --- a/reference/harden.rubification.html +++ b/reference/harden.rubification.html @@ -176,7 +176,6 @@

    Examples

    plot.order = jacobs2000$rubiforder, max.depth = 250 ) -#> [1] 1.030629 segments( x0 = 0.5, diff --git a/reference/harmonize-SoilProfileCollection-method.html b/reference/harmonize-SoilProfileCollection-method.html index 5d1d4f78..a9ce5c40 100644 --- a/reference/harmonize-SoilProfileCollection-method.html +++ b/reference/harmonize-SoilProfileCollection-method.html @@ -137,12 +137,10 @@

    Examples

    # inspect result plotSPC(h1, color = "foo") -#> [1] 5.59328 # filter with calculated "harmonized group" to get just RV profiles plotSPC(subset(h1, hgroup == "q50"), color="foo") -#> [1] 1.864427 ### single source, two properties at once; with common labels: "method1" "method2" @@ -152,10 +150,8 @@

    Examples

    bar = c(method1 = "p3", method2 = "p4"))) plotSPC(h3, color = "foo") -#> [1] 6.935273 plotSPC(h3, color = "bar") -#> [1] 6.935273 head(horizons(h3)) #> id top bottom foo bar hzID #> 1 10_method1 0 20 -12.83190 10.08068 1 @@ -170,20 +166,16 @@

    Examples

    bar = c(method2 = "p3", method3 = "p4"))) plotSPC(h3, color = "foo") # note the pattern of values missing for foo (*_method3) -#> [1] 10.40291 plotSPC(h3, color = "bar") # likewise for bar (*_method1) -#> [1] 10.40291 #' the new labels need not match across harmonizations -- not sure how useful this is but it works h3 <- harmonize(spc, x.names = list(foo = c(method1 = "p1", method2 = "p2"), bar = c(method3 = "p3", method4 = "p4"))) plotSPC(h3, color = "foo") # note the pattern of values missing for foo (*_method 3 + 4) -#> [1] 13.87055 plotSPC(h3, color = "bar") # likewise for bar (*_method 1 + 2) -#> [1] 13.87055 ### two-source harmonization @@ -197,7 +189,6 @@

    Examples

    # same property with different name in two different datasets plotSPC(h4, color = "foo") -#> [1] 3.656111 ### many source harmonization @@ -224,7 +215,6 @@

    Examples

    # inspect a subset plotSPC(bigspc[1:30,], color = "foo") -#> [1] 3.252649
    diff --git a/reference/horizonColorIndices.html b/reference/horizonColorIndices.html index 5eec5375..737e4960 100644 --- a/reference/horizonColorIndices.html +++ b/reference/horizonColorIndices.html @@ -141,17 +141,14 @@

    Examples

    # visualize par(mar = c(0, 1, 3, 1)) plotSPC(sp1, color='hurst_redness', name = 'm') -#> [1] 1.215197 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plotSPC(sp1, color='barron_torrent_redness', name = 'm') -#> [1] 1.215197 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plotSPC(sp1, color='buntley_westin', name = 'm') -#> [1] 1.215197 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() diff --git a/reference/hzDistinctnessCodeToOffset.html b/reference/hzDistinctnessCodeToOffset.html index be2616df..45a78cab 100644 --- a/reference/hzDistinctnessCodeToOffset.html +++ b/reference/hzDistinctnessCodeToOffset.html @@ -150,7 +150,6 @@

    Examples

    # sketches, adjust width, adjust text size, include coded hz distinctness offsets plotSPC(sp1, width=0.3, cex.names=0.75, hz.distinctness.offset = 'hzdo') -#> [1] 0.5979017 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() diff --git a/reference/hz_segment.html b/reference/hz_segment.html index a271cf07..26a3db04 100644 --- a/reference/hz_segment.html +++ b/reference/hz_segment.html @@ -144,15 +144,12 @@

    Examples

    par(mar = c(0, 0, 3, 1)) plotSPC(z, color = 'segment_id', width = 0.3) -#> [1] 1.177614 # highlight new horizon records par(mar = c(0, 0, 2, 1)) plotSPC(z, color = NA, default.color = NA, width = 0.3, lwd = 1) -#> [1] 1.177614 plotSPC(sp1, color = NA, default.color = NA, width = 0.3, lwd = 3, add = TRUE, name = NA, print.id = FALSE) -#> [1] 1.177614 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() legend('top', horiz = TRUE, diff --git a/reference/hz_to_taxpartsize.html b/reference/hz_to_taxpartsize.html index 63c706e0..923b4f6c 100644 --- a/reference/hz_to_taxpartsize.html +++ b/reference/hz_to_taxpartsize.html @@ -171,6 +171,11 @@

    Examples

    depths(h) <- id ~ top + bottom +# set required metadata for estimatePSCS() +hzdesgnname(h) <- "hzname" +hztexclname(h) <- "texcl" +hzmetaname(h, "clay") <- "clay" + pscs <- data.frame(id = h$id, rbind(estimatePSCS(h))) names(pscs)[2:3] <- c("top", "bottom") diff --git a/reference/hzmetaname.html b/reference/hzmetaname.html new file mode 100644 index 00000000..ebad6264 --- /dev/null +++ b/reference/hzmetaname.html @@ -0,0 +1,200 @@ + +Get or Set Horizon Metadata Column Name — hzmetaname • aqp + + +
    +
    + + + +
    +
    + + +
    +

    hzmetaname(): Get column name containing horizon data of interest

    +

    hzmetaname<-: Set horizon designation column name

    +
    + +
    +
    # S4 method for SoilProfileCollection
    +hzmetaname(object, attr, required = FALSE)
    +
    +# S4 method for SoilProfileCollection
    +hzmetaname(object, attr, required = FALSE) <- value
    +
    + +
    +

    Arguments

    +
    object
    +

    A SoilProfileCollection

    + + +
    attr
    +

    character. Base name for attribute to be stored in metadata. This is prefixed with "aqp_hz" for horizon-level metadata for column attributes. e.g. attr="clay" results in metadata value retrieved from "aqp_hzclay".

    + + +
    required
    +

    logical. Is this attribute required? If it is, set to TRUE to trigger error on invalid value.

    + + +
    value
    +

    character. Name of horizon-level column containing data corresponding to attr.

    + +
    +
    +

    Details

    +

    Store the column name containing a specific type of horizon data in the metadata slot of the SoilProfileCollection.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    
    +data(sp1)
    +
    +# promote to SPC
    +depths(sp1) <- id ~ top + bottom
    +
    +# set important metadata columns
    +hzdesgnname(sp1) <- "name"
    +hztexclname(sp1) <- "texture"
    +
    +# set custom horizon property (clay content) column
    +hzmetaname(sp1, "clay") <- "prop"
    +
    +# inspect metadata list
    +metadata(sp1)
    +#> $aqp_df_class
    +#> [1] "data.frame"
    +#> 
    +#> $aqp_group_by
    +#> [1] ""
    +#> 
    +#> $aqp_hzdesgn
    +#> [1] "name"
    +#> 
    +#> $aqp_hztexcl
    +#> [1] "texture"
    +#> 
    +#> $depth_units
    +#> [1] "cm"
    +#> 
    +#> $stringsAsFactors
    +#> [1] FALSE
    +#> 
    +#> $aqp_hzclay
    +#> [1] "prop"
    +#> 
    +
    +# get horizon clay content column
    +hzmetaname(sp1, "clay")
    +#> [1] "prop"
    +
    +# uses hzdesgname(), hztexclname(), hzmetaname(attr="clay") in function definition
    +estimatePSCS(sp1)
    +#>     id pscs_top pscs_bottom
    +#> 1 P001       49          89
    +#> 2 P002       30          59
    +#> 3 P003        2          52
    +#> 4 P004       32          62
    +#> 5 P005        5          55
    +#> 6 P006       31         106
    +#> 7 P007       25         100
    +#> 8 P008       27         102
    +#> 9 P009       28         103
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.9.

    +
    + +
    + + + + + + + + diff --git a/reference/index.html b/reference/index.html index 8c18274e..e73626cf 100644 --- a/reference/index.html +++ b/reference/index.html @@ -538,6 +538,10 @@

    All functions `hzidname<-`(<SoilProfileCollection>) hzidname(<SoilProfileCollection>)

    Set horizon ID column name

    + +

    hzmetaname(<SoilProfileCollection>) `hzmetaname<-`(<SoilProfileCollection>)

    + +

    Get or Set Horizon Metadata Column Name

    hztexclname(<SoilProfileCollection>) `hztexclname<-`(<SoilProfileCollection>)

    diff --git a/reference/jacobs2000.html b/reference/jacobs2000.html index f0a06311..8c5d64ee 100644 --- a/reference/jacobs2000.html +++ b/reference/jacobs2000.html @@ -113,7 +113,6 @@

    Examples

    # basic plot par(mar=c(0, 1, 3, 1.5)) plotSPC(jacobs2000, name='name', color='matrix_color', width=0.3) -#> [1] 0.8523367 # add concentrations addVolumeFraction(jacobs2000, 'concentration_pct', col = jacobs2000$concentration_color, pch = 16, cex.max = 0.5) @@ -121,7 +120,6 @@

    Examples

    # add depletions plotSPC(jacobs2000, name='name', color='matrix_color', width=0.3) -#> [1] 0.8523367 addVolumeFraction(jacobs2000, 'depletion_pct', col = jacobs2000$depletion_color, pch = 16, cex.max = 0.5) @@ -129,7 +127,6 @@

    Examples

    # time saturated plotSPC(jacobs2000, color='time_saturated', cex.names=0.8, col.label = 'Time Saturated') -#> [1] 0.4544975 # color contrast: matrix vs. concentrations cc <- colorContrast(jacobs2000$matrix_color_munsell, jacobs2000$concentration_munsell) diff --git a/reference/mollic.thickness.requirement.html b/reference/mollic.thickness.requirement.html index e7470783..f25c62ab 100644 --- a/reference/mollic.thickness.requirement.html +++ b/reference/mollic.thickness.requirement.html @@ -83,9 +83,9 @@

    Calculate the minimum thickness requirement for Mollic epipedon

    mollic.thickness.requirement(
       p,
    -  hzdesgn = guessHzDesgnName(p),
    -  texcl.attr = guessHzTexClName(p),
    -  clay.attr = guessHzAttrName(p, "clay", c("total", "_r")),
    +  hzdesgn = hzdesgnname(p, required = TRUE),
    +  texcl.attr = hztexclname(p, required = TRUE),
    +  clay.attr = hzmetaname(p, "clay", required = TRUE),
       truncate = TRUE
     )
    diff --git a/reference/munsell2spc-SoilProfileCollection-method.html b/reference/munsell2spc-SoilProfileCollection-method.html index f3bc2693..7c3040b9 100644 --- a/reference/munsell2spc-SoilProfileCollection-method.html +++ b/reference/munsell2spc-SoilProfileCollection-method.html @@ -191,12 +191,10 @@

    Examples

    # plot rgb "R" coordinate by horizon plot(sp3, color = "rgb_R") -#> [1] 0.4231771 # plot lab "A" coordinate by horizon plot(sp3, color = "lab_A") -#> [1] 0.4231771 # note that `lab_A` values do not exactly match the original `A` values # this is because `lab_A` was computed from the (field determined) Munsell color notation, diff --git a/reference/pbindlist.html b/reference/pbindlist.html index eec1d671..67e9e195 100644 --- a/reference/pbindlist.html +++ b/reference/pbindlist.html @@ -133,7 +133,6 @@

    Examples

    # check plot(z) -#> [1] 2.934726
    diff --git a/reference/perturb.html b/reference/perturb.html index d7fad6c4..32327c86 100644 --- a/reference/perturb.html +++ b/reference/perturb.html @@ -178,7 +178,6 @@

    Examples

    # plot par(mfrow = c(2, 1), mar = c(0, 0, 0, 0)) plot(sim.1) -#> [1] 2.815755 mtext( 'SD = 2', side = 2, @@ -187,7 +186,6 @@

    Examples

    cex = 0.75 ) plot(sim.2) -#> [1] 2.815755 mtext( 'SD = c(1, 2, 5, 5, 5, 10, 3)', side = 2, diff --git a/reference/profileApply.html b/reference/profileApply.html index b036d97a..a2e7f5ed 100644 --- a/reference/profileApply.html +++ b/reference/profileApply.html @@ -150,7 +150,6 @@

    Examples

    # scaled = (x - mean(x)) / sd(x) sp1$d <- profileApply(sp1, FUN=function(x) round(scale(x$prop), 2)) plot(sp1, name='d') -#> [1] 1.403299 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() @@ -160,7 +159,6 @@

    Examples

    f <- function(x) { c(x$prop[1], diff(x$prop)) } sp1$d <- profileApply(sp1, FUN=f) plot(sp1, name='d') -#> [1] 1.403299 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() @@ -169,7 +167,6 @@

    Examples

    # note the use of an anonymous function sp1$d <- profileApply(sp1, FUN=function(x) cumsum(x$prop)) plot(sp1, name='d') -#> [1] 1.403299 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() @@ -181,7 +178,6 @@

    Examples

    # re-plot using ranks defined by computed summaries (in @site) plot(sp1, plot.order=rank(sp1$mean_prop)) -#> [1] 1.403299 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() @@ -319,13 +315,11 @@

    Examples

    # graphically check par(mfrow=c(2,1), mar=c(0,0,1,0)) plot(sp1) -#> [1] 1.142285 #> [P001:6] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() points(1:length(sp1), sp1$dep, col='red', pch=7) plot(sp1.sub) -#> [1] 1.142285
    diff --git a/reference/profileGroupLabels.html b/reference/profileGroupLabels.html index db1aac17..f84e37b5 100644 --- a/reference/profileGroupLabels.html +++ b/reference/profileGroupLabels.html @@ -175,7 +175,6 @@

    Examples

    # plot 2 SoilProfileCollection objects on the same axis par(mar=c(1,1,1,1)) plotSPC(sp3, n = n.pedons) -#> [1] 0.3664533 plotSPC(sp4, add = TRUE, x.idx.offset = group.ends[1], depth.axis = FALSE, id.style = 'side') diff --git a/reference/profileInformationIndex.html b/reference/profileInformationIndex.html index ae12b248..c334c381 100644 --- a/reference/profileInformationIndex.html +++ b/reference/profileInformationIndex.html @@ -187,7 +187,6 @@

    Examples

    # visual check par(mar = c(1, 0, 3, 3)) plotSPC(z, color = 'p', name.style = 'center-center', cex.names = 0.8, max.depth = 110) -#> [1] 0.09175395 # factor version of horizon name z$fname <- factor(z$name) diff --git a/reference/quickSPC.html b/reference/quickSPC.html index 50077650..8275a438 100644 --- a/reference/quickSPC.html +++ b/reference/quickSPC.html @@ -149,7 +149,6 @@

    Examples

    s <- quickSPC(x) plotSPC(s, name.style = 'center-center', cex.names = 1) -#> [1] 0.0526272 # character template, mode 1 # horizon thickness is generated at random (uniform [5,20]) @@ -158,7 +157,6 @@

    Examples

    s <- quickSPC(x) plotSPC(s, name.style = 'center-center', cex.names = 1) -#> [1] 0.1835554 # multiple templates @@ -172,7 +170,6 @@

    Examples

    s <- quickSPC(x) plotSPC(s, name.style = 'center-center', cex.names = 1) -#> [1] 0.6017337 # optionally specify profile IDs using "ID:" prefix @@ -185,7 +182,6 @@

    Examples

    s <- quickSPC(x) plotSPC(s, name.style = 'center-center', cex.names = 1) -#> [1] 0.1578816 # optionally specify: @@ -199,7 +195,6 @@

    Examples

    s <- quickSPC(x) plotSPC(s, name.style = 'center-center', cex.names = 1) -#> [1] 0.3094048 # use newline character as delimiter, more compact x <- 'Oe,10,10YR 2/2 @@ -211,7 +206,6 @@

    Examples

    plotSPC(quickSPC(x), name.style = 'center-center', cex.names = 1) -#> [1] 0.1865946 # character template, mode 2 @@ -232,7 +226,6 @@

    Examples

    hz.depths = TRUE ) -#> [1] 0.5846978 # each horizon label is '5' depth-units s <- quickSPC(x, interval = 5) @@ -241,7 +234,6 @@

    Examples

    hz.depths = TRUE ) -#> [1] 0.600454 # optionally specify some / all profile IDs with "ID:" prefix x <- c( @@ -256,7 +248,6 @@

    Examples

    hz.depths = TRUE ) -#> [1] 0.3052458 # make a NODATA profile, with a random hash ID @@ -268,7 +259,6 @@

    Examples

    cex.names = 1, depth.axis = FALSE, hz.depths = TRUE) -#> [1] 0.2012711
    diff --git a/reference/random_profile.html b/reference/random_profile.html index e9278ef3..e3662eb4 100644 --- a/reference/random_profile.html +++ b/reference/random_profile.html @@ -214,7 +214,6 @@

    Examples

    opar <- par(mar=c(0,0,3,2)) plotSPC(d, color='p1', name='name', cex.names=0.75) -#> [1] 0.1832267 par(opar) # simulate horizon boundary distinctness codes: @@ -226,7 +225,6 @@

    Examples

    opar <- par(mar=c(0,0,3,2)) plotSPC(d, name='name', color='p1', hz.distinctness.offset='HzD') -#> [1] 0.3664533 par(opar) @@ -239,7 +237,6 @@

    Examples

    # plot plotSPC(d.1, name='name', color='p1', col.label = 'LPP Defaults') -#> [1] 0.3444661 # do this again, this time set all of the LPP parameters @@ -250,7 +247,6 @@

    Examples

    # plot plotSPC(d.2, name='name', color='p1', col.label = 'Custom LPP Parameters') -#> [1] 0.3444661 # reset plotting defaults diff --git a/reference/repairMissingHzDepths.html b/reference/repairMissingHzDepths.html index 493c8576..11e73b9f 100644 --- a/reference/repairMissingHzDepths.html +++ b/reference/repairMissingHzDepths.html @@ -125,7 +125,6 @@

    Examples

    # inspect data before repairs plotSPC(h) -#> [1] 0.1154119 #> [1:3] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() #> [2:4] horizon with top == bottom, cannot fix horizon depth overlap @@ -141,7 +140,6 @@

    Examples

    # inspect plotSPC(g) -#> [1] 0.1154119 # no adj, max.depth only f <- repairMissingHzDepths(h, adj = NA, max.depth = 200) @@ -149,7 +147,6 @@

    Examples

    #> [1] TRUE plotSPC(f) -#> [1] 0.1154119 # max.depth defaults to max(x) if too small f$bottom[c(3,7)] <- NA @@ -159,7 +156,6 @@

    Examples

    #> [1] TRUE plotSPC(d) -#> [1] 0.1154119
    diff --git a/reference/rowley2019.html b/reference/rowley2019.html index 65f31be7..41fb7a9f 100644 --- a/reference/rowley2019.html +++ b/reference/rowley2019.html @@ -275,16 +275,13 @@

    Examples

    par(mar=c(1,1,3,1)) plotSPC(rowley2019, color='Feo_Fed', name='name', cex.names=0.85) -#> [1] 0.2308428 plotSPC(rowley2019, color='Ca_exch', name='name', cex.names=0.85) -#> [1] 0.2308428 # grouped plot groupedProfilePlot(rowley2019, groups = 'group', color='Ca_exch', name='name', cex.names=0.85, group.name.offset = -10) -#> [1] 0.2308428 # aggregate over 1cm slices, for select properties a <- slab(rowley2019, group ~ Reactive_carbonate + Ca_exch + pH + K_Feldspar + Na_Plagioclase + Al) diff --git a/reference/sierraTransect.html b/reference/sierraTransect.html index 04d87e84..af706634 100644 --- a/reference/sierraTransect.html +++ b/reference/sierraTransect.html @@ -122,7 +122,6 @@

    Examples

    # quick sketch plotSPC(sierraTransect, name.style = 'center-center', width=0.3) -#> [1] 2.358138 # split by transect par(mar=c(0,0,1,1)) @@ -132,7 +131,6 @@

    Examples

    name.style='center-center' ) -#> [1] 2.43107 # thematic groupedProfilePlot( @@ -141,7 +139,6 @@

    Examples

    name.style='center-center', color='Fe_o_to_Fe_d' ) -#> [1] 2.43107 # horizon boundary viz sierraTransect$hzd <- hzDistinctnessCodeToOffset(substr(sierraTransect$hz_boundary, 0, 1)) @@ -151,7 +148,6 @@

    Examples

    width=0.3, name.style='center-center', color='Fe_o_to_Fe_d', hz.distinctness.offset='hzd') -#> [1] 2.43107 # split transects @@ -164,11 +160,9 @@

    Examples

    # order (left -> right) by elevation par(mar=c(2,0,0,2), mfrow=c(2,1)) plot(g, width=0.3, name.style='center-center', cex.names=0.75, plot.order=g.order) -#> [1] 0.7214442 axis(1, at=1:length(g), labels=g$elev[g.order], line=-1.5) plot(a, width=0.3, name.style='center-center', cex.names=0.75, plot.order=a.order) -#> [1] 0.5329192 axis(1, at=1:length(a), labels=a$elev[a.order], line=-1.5) diff --git a/reference/slice.html b/reference/slice.html index f9c60bf7..ed8c09c6 100644 --- a/reference/slice.html +++ b/reference/slice.html @@ -203,7 +203,6 @@

    Examples

    par(mar=c(0,1,0,1)) plotSPC(s) -#> [1] 1.032732 # generate slices from 0 - 11 cm, for all variables s <- dice(d, fm = 0:10 ~ .) diff --git a/reference/sp1.html b/reference/sp1.html index e33b6d46..f136e001 100644 --- a/reference/sp1.html +++ b/reference/sp1.html @@ -159,7 +159,6 @@

    Examples

    # plot, note slices plot(s) -#> [1] 1.403299 # aggregate all profiles along 1 cm depth slices, diff --git a/reference/sp2.html b/reference/sp2.html index fe36033b..f8479a59 100644 --- a/reference/sp2.html +++ b/reference/sp2.html @@ -185,14 +185,12 @@

    Examples

    par(mar=c(1,0,3,0)) plot(sp2, plot.order=p.order) -#> [1] 2.922331 # setup multi-figure output par(mfrow=c(2,1), mar=c(0,0,1,0)) # truncate plot to 200 cm depth plot(sp2, plot.order=p.order, max.depth=200) -#> [1] 2.922331 abline(h=200, lty=2, lwd=2) # compute numerical distances between profiles diff --git a/reference/sp3.html b/reference/sp3.html index a9f2bba9..dec705a7 100644 --- a/reference/sp3.html +++ b/reference/sp3.html @@ -273,13 +273,11 @@

    Examples

    #> $ contributing_fraction: num 0.89 1 1 1 1 1 0.9 0.9 0.58 0.15 ... #> $ top : int 0 10 20 30 40 50 60 70 80 90 ... #> $ bottom : int 10 20 30 40 50 60 70 80 90 100 ... -#> [1] 0.7949667 #> Computing dissimilarity matrices from 13 profiles #> [0.3 Mb] -#> [1] 0.2290074

    diff --git a/reference/sp4.html b/reference/sp4.html index 593cdafc..71f46012 100644 --- a/reference/sp4.html +++ b/reference/sp4.html @@ -409,7 +409,6 @@

    Examples

    # basic plot method, highly customizable: see manual page ?plotSPC plot(sp4) -#> [1] 2.517548 # inspect plotting area, very simple to overlay graphical elements abline(v=1:length(sp4), lty=3, col='blue') # profiles are centered at integers, from 1 to length(obj) @@ -423,10 +422,8 @@

    Examples

    par(mar=c(0,0,4,0)) plot(sp4, color='clay') -#> [1] 2.049284 plot(sp4, color='CF') -#> [1] 2.049284 # apply a function to each profile, returning a single value per profile, # in the same order as profile_id(sp4) @@ -464,7 +461,6 @@

    Examples

    par(mar=c(0,0,0,0)) plot(sp4, plot.order=new.order) -#> [1] 2.049284 # deconstruct SoilProfileCollection into a data.frame, with horizon+site data as(sp4, 'data.frame') diff --git a/reference/sp6.html b/reference/sp6.html index 9daf25ed..f8d42ee8 100644 --- a/reference/sp6.html +++ b/reference/sp6.html @@ -156,27 +156,22 @@

    Examples

    # profile sketches par(mar=c(0,0,3,0)) plot(sp6, color='soil_color') -#> [1] 0.50625 #> [A-1:12] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plot(sp6, color='Mn') -#> [1] 0.50625 #> [A-1:12] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plot(sp6, color='Fe') -#> [1] 0.50625 #> [A-1:12] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plot(sp6, color='pH') -#> [1] 0.50625 #> [A-1:12] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() plot(sp6, color='texture') -#> [1] 0.50625 #> [A-1:12] horizon with top == bottom, cannot fix horizon depth overlap #> consider using repairMissingHzDepths() diff --git a/reference/spc2mpspline-SoilProfileCollection-method.html b/reference/spc2mpspline-SoilProfileCollection-method.html index bddca74c..fcbf6365 100644 --- a/reference/spc2mpspline-SoilProfileCollection-method.html +++ b/reference/spc2mpspline-SoilProfileCollection-method.html @@ -150,7 +150,6 @@

    Examples

    plotSPC(res[1:5,], color = "prop_spline", divide.hz = FALSE) } -#> [1] 0.7796104

    diff --git a/reference/subsetHz-SoilProfileCollection-method.html b/reference/subsetHz-SoilProfileCollection-method.html index c27a3658..e1c8a300 100644 --- a/reference/subsetHz-SoilProfileCollection-method.html +++ b/reference/subsetHz-SoilProfileCollection-method.html @@ -120,7 +120,6 @@

    Examples

    # show just horizons with 10YR hues plot(subsetHz(sp3, hue == '10YR')) -#> [1] 0.3462358
    diff --git a/reference/subsetProfiles.html b/reference/subsetProfiles.html index 7740a44d..a7cba35c 100644 --- a/reference/subsetProfiles.html +++ b/reference/subsetProfiles.html @@ -134,20 +134,17 @@

    Examples

    # subset by integer index, note that this does not re-order the profiles plot(sp2[1:5, ]) -#> [1] 1.044266 # generate an integer index via pattern-matching idx <- grep('modesto', sp2$surface, ignore.case=TRUE) plot(sp2[idx, ]) -#> [1] 1.578496 # generate in index via profileApply: # subset those profiles where: min(ph) < 5.6 idx <- which(profileApply(sp2, function(i) min(i$field_ph, na.rm=TRUE) < 5.6)) plot(sp2[idx, ]) -#> [1] 0.8661893

    diff --git a/reference/thompson.bell.darkness.html b/reference/thompson.bell.darkness.html index 6d5a8ed1..cf99b3d3 100644 --- a/reference/thompson.bell.darkness.html +++ b/reference/thompson.bell.darkness.html @@ -83,7 +83,7 @@

    Thompson-Bell (1996) Index

    thompson.bell.darkness(
       p,
    -  name = guessHzDesgnName(p, required = TRUE),
    +  name = hzdesgnname(p, required = TRUE),
       pattern = "^A",
       value = "m_value",
       chroma = "m_chroma"
    diff --git a/reference/unique.html b/reference/unique.html
    index 2add8980..eb9a68fc 100644
    --- a/reference/unique.html
    +++ b/reference/unique.html
    @@ -133,23 +133,18 @@ 

    Examples

    # graphical check plotSPC(x.dupes, name.style = 'center-center') -#> [1] 0.7134265 plotSPC(x.sim, name.style = 'center-center') -#> [1] 0.7134265 # inspect unique results plotSPC(unique(x.dupes, vars = c('top', 'bottom')), name.style = 'center-center') -#> [1] 0.1426853 # uniqueness is a function of variable selection plotSPC(unique(x.sim, vars = c('top', 'bottom')), name.style = 'center-center') -#> [1] 0.7134265 plotSPC(unique(x.sim, vars = c('name')), name.style = 'center-center') -#> [1] 0.1426853 diff --git a/reference/warpHorizons.html b/reference/warpHorizons.html index 1dfd542d..ee9749b0 100644 --- a/reference/warpHorizons.html +++ b/reference/warpHorizons.html @@ -150,7 +150,6 @@

    Examples

    depth.axis = list(line = -3), y.offset = .yoff ) -#> [1] 0.1062791 #> depth axis is disabled when more than 1 unique y offsets are supplied # illustrate warping with arrows @@ -195,7 +194,6 @@

    Examples

    depth.axis = list(line = -2) ) -#> [1] 0.3265414
    diff --git a/reference/wilson2022.html b/reference/wilson2022.html index fa5c7dfa..50ac5a01 100644 --- a/reference/wilson2022.html +++ b/reference/wilson2022.html @@ -135,7 +135,6 @@

    Examples

    cex.names = 0.66, cex.id = 0.66, width = 0.3, depth.axis = FALSE, hz.depths = TRUE) -#> [1] 1.189991 groupedProfilePlot(wilson2022, groups = 'biome', group.name.offset = -15, label = 'pm', @@ -143,7 +142,6 @@

    Examples

    cex.names = 0.66, cex.id = 0.66, width = 0.3, depth.axis = FALSE, hz.depths = TRUE) -#> [1] 1.02759

    diff --git a/sitemap.xml b/sitemap.xml index f02eff82..4ad94b71 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -381,6 +381,9 @@ /reference/hzidname.html + + /reference/hzmetaname.html + /reference/hztexclname.html