Generate a boolean matrix of soil depth classes from a SoilProfileCollection object.

getSoilDepthClass(
  f,
  depth.classes = c(very.shallow = 25, shallow = 50, mod.deep = 100, deep = 150,
    very.deep = 1000),
  ...
)

Arguments

f

a SoilProfileCollection object

depth.classes

a named vector of classes and depth breaks

...

arguments passed to estimateSoilDepth

Value

a data.frame containing soil depth and depth class for each profile, see examples

See also

Author

D.E. Beaudette and J.M. Skovlin

Examples


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

# generate depth-class matrix
sdc <- getSoilDepthClass(sp1, name='name')

# inspect
head(sdc)
#>     id depth very.shallow shallow mod.deep  deep very.deep depth.class
#> 1 P001    89        FALSE   FALSE     TRUE FALSE     FALSE    mod.deep
#> 2 P002    59        FALSE   FALSE     TRUE FALSE     FALSE    mod.deep
#> 3 P003    67        FALSE   FALSE     TRUE FALSE     FALSE    mod.deep
#> 4 P004    62        FALSE   FALSE     TRUE FALSE     FALSE    mod.deep
#> 5 P005    68        FALSE   FALSE     TRUE FALSE     FALSE    mod.deep
#> 6 P006   200        FALSE   FALSE    FALSE FALSE      TRUE   very.deep

# join back into sp1 as site-level data
site(sp1) <- sdc

if (FALSE) {
# sample data
data(gopheridge, package='soilDB')

getSoilDepthClass(gopheridge)
}