hzAbove | R Documentation |
Horizons Above or Below
hzAbove(x, ..., offset = 1, SPC = TRUE, simplify = SPC)
hzBelow(x, ..., offset = 1, SPC = TRUE, simplify = SPC)
hzOffset(x, hzid, offset, SPC = FALSE, simplify = TRUE)
x |
A SoilProfileCollection |
... |
Comma-separated set of R expressions that evaluate as |
offset |
Integer offset in terms of SoilProfileCollection |
SPC |
Return a SoilProfileCollection? Default |
simplify |
If |
hzid |
A vector of target horizon IDs. These are calculated from |
To minimize likelihood of issues with non-standard evaluation context, especially when using hzAbove()
/hzBelow()
inside another function, all expressions used in ...
should be in terms of variables that are in the horizon data frame.
A SoilProfileCollection (when SPC = TRUE
) or a vector of horizon row indices (when SPC = FALSE
and simplify = TRUE
) or a list (when SPC = FALSE
and simplify = FALSE
))
data(sp4)
depths(sp4) <- id ~ top + bottom
# get the horizon above the last horizon (j-index of bottom horizon minus 1)
hzAbove(sp4, hzID(sp4) %in% getLastHorizonID(sp4))
# get horizons below the last horizon (none; j-index of bottom horizon plus 1)
hzBelow(sp4, hzID(sp4) %in% getLastHorizonID(sp4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.