Efficient Slicing of SoilProfileCollection Objects
Source: R/dice.R
dice-SoilProfileCollection-method.RdCut ("dice") soil horizons into 1-unit thick slices. This function replaces aqp::slice(), which will be deprecated in aqp 2.0.
Usage
# S4 method for class 'SoilProfileCollection'
dice(
x,
fm = NULL,
SPC = TRUE,
pctMissing = FALSE,
fill = FALSE,
strict = TRUE,
byhz = TRUE,
verbose = FALSE
)Arguments
- x
a
SoilProfileCollectionobject- fm
optional
formuladescribing top depths and horizon level attributes to include:integer.vector ~ var1 + var2 + var3orinteger.vector ~ .to include all horizon level attributes. Specification ofinteger.vectorforcesfill = TRUE. WhenNULLprofiles are "diced" to depth and results will include all horizon level attributes. Note on interpretation ofinteger.vector(slice tops)- SPC
return the diced
SoilPrfolileCollection, ifFALSEadata.frameof horizon-level attributes- pctMissing
compute "percent missing data" by slice (when
TRUEexpect 6-8x longer run time)- fill
logical, fill with empty placeholder horizons in gaps within profiles, and/or, above/below interval specified in
fm. Automatically set toTRUEwhen LHS offmis specified. Backwards compatibility withsliceis maintained by settingfill = TRUEwith or withoutfm.- strict
perform horizon depth logic checking / flagging / removal
- byhz
Evaluate horizon depth logic at the horizon level (
TRUE) or profile level (FALSE). Invalid depth logic invokesHzDepthLogicSubsetwhich removes offending profiles or horizon records.- verbose
Print information about object size/memory usage. Default:
FALSE
Details
For large and potentially messy collections that may include missing horizon depth logic errors, consider using repairMissingHzDepths() before dice(). Consider using accumulateDepths() before invoking dice() on collections that may contain old-style O horizon notation (e.g. 5-0cm).