View source: R/checkHzDepthLogic.R
checkHzDepthLogic | R Documentation |
This function inspects a SoilProfileCollection
object, looking for four common errors in horizon depths:
bottom depth shallower than top depth
equal top and bottom depth
missing top or bottom depth (e.g. NA
)
gap or overlap between adjacent horizons (only if byhz = FALSE
)
checkHzDepthLogic(
x,
hzdepths = NULL,
idname = NULL,
fast = FALSE,
byhz = FALSE
)
x |
|
hzdepths |
character vector, describing top and bottom depths in a |
idname |
character, describing the column containing profile IDs in a |
fast |
logical, When |
byhz |
logical, apply logic tests to profiles ( |
A data.frame
containing profile IDs, validity boolean (valid
) and test results if fast = FALSE
.
The data.frame
will have as many rows as profiles in x
(length(x)
).
id
: Profile IDs, named according to idname(x)
valid
: boolean, profile passes all of the following tests
depthLogic
: boolean, errors related to depth logic
sameDepth
: boolean, errors related to same top/bottom depths
missingDepth
: boolean, NA in top / bottom depths
overlapOrGap
: boolean, gaps or overlap in adjacent horizons (NA
when byhz = TRUE
)
D.E. Beaudette, A.G. Brown, S.M. Roecker
## sample data
data(sp3)
depths(sp3) <- id ~ top + bottom
# these data should be clean
res <- checkHzDepthLogic(sp3)
head(res)
# less memory if only concerned about net validity
res <- checkHzDepthLogic(sp3, fast = TRUE)
head(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.