Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

glom-SoilProfileCollection-method

Subset soil horizon data using a depth or depth interval


Description

glom() returns a "clod" of horizons from a SoilProfileCollection from a depth interval.

All horizons included within the specified interval are returned in their entirety (not just the portion within the interval), unless the truncate argument is specified. Horizon intersection is based on unique ID hzidname(spc) and attribute of interest.

If intersection at the specified boundaries ['z1', 'z2'] results in no horizon data, 'NULL' is returned with a warning containing the offending pedon ID.

If inverting results with invert, it is possible that thick horizons (that span more than the entire glom interval) will be split into two horizons. This may make the results from ids = TRUE different from what you expect, as they will be based on a profile with an "extra" horizon.

Usage

## S4 method for signature 'SoilProfileCollection'
glom(
  p,
  z1,
  z2 = NULL,
  ids = FALSE,
  df = FALSE,
  truncate = FALSE,
  invert = FALSE,
  modality = "all"
)

Arguments

p

A SoilProfileCollection

z1

Top depth (required) - depth to intersect horizon; if 'z2' specified, top depth of intersection interval.

z2

optional: bottom depth of intersection interval

ids

Return only horizon IDs? default: FALSE

df

Return a data.frame, by intersection with horizons(p)? default: FALSE

truncate

Truncate horizon top and bottom depths to z1 and z2? default: FALSE

invert

Get the horizons ranges outside the interval z1/z2? default: FALSE

modality

Return all horizons (default: "all") or first, thickest (modality = "thickest") horizon in interval.

Details

The verb/function that creates a clod is "glom". "To glom" is "to steal" or to "become stuck or attached to". The word is related to the compound "glomalin", which is a glycoprotein produced by mycorrhizal fungi in soil.

Value

A SoilProfileCollection, data.frame, or a vector of horizon IDs. NULL if no result.

Author(s)

Andrew G. Brown

See Also

Examples

data(sp1, package = 'aqp')
depths(sp1) <- id ~ top + bottom
site(sp1) <- ~ group

p <- sp1[1]

foo <- glom(p, 25, 100)

# there are 4 horizons in the clod glommed from depths 25 to 100 on profile 1 in sp1
nrow(foo)

aqp

Algorithms for Quantitative Pedology

v1.29
GPL (>= 3)
Authors
Dylan Beaudette [aut, cre], Pierre Roudier [aut, ctb], Andrew Brown [aut, ctb]
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.