Learn R Programming

aqp (version 2.1.0)

aggregateSoilDepth: Probabilistic Estimation of Soil Depth within Groups

Description

Estimate the most-likely depth to contact within a collection of soil profiles. Consider getSoilDepthClass followed by group-wise percentile estimation as a faster alternative.

Usage

aggregateSoilDepth(
  x,
  groups,
  crit.prob = 0.9,
  name = hzdesgnname(x),
  p = "Cr|R|Cd",
  ...
)

Value

A data.frame is returned, with as many rows as there are unique group labels, as specified in groups.

Arguments

x

a SoilProfileCollection object

groups

the name of a site-level attribute that defines groups of profiles within a collection

crit.prob

probability cutoff used to determine where the most likely depth to contact will be, e.g. 0.9 translates to 90% of profiles are shallower than this depth

name

horizon-level attribute where horizon designation is stored, defaults to hzdesgnname(x)

p

a REGEX pattern that matches non-soil genetic horizons

...

additional arguments to slab

Author

D.E. Beaudette

Details

This function computes a probability-based estimate of soil depth by group. If no grouping variable exists, a dummy value can be used to compute a single estimate. The crit.prob argument sets the critical probability (e.g. 0.9) at which soil depth within a group of profiles is determined. For example, a crit.prob of 0.95 might result in an estimated soil depth (e.g. 120cm) where 95% of the profiles (by group) had depths that were less than or equal to 120cm.

See Also

estimateSoilDepth() slab()

Examples

Run this code

data(sp1)
depths(sp1) <- id ~ top + bottom
site(sp1) <- ~ group

# set horizon designation in SPC
hzdesgnname(sp1) <- 'name'

aggregateSoilDepth(sp1, 'group', crit.prob = 0.9)

Run the code above in your browser using DataLab