Learn R Programming

aqp (version 2.1.0)

splitLogicErrors: Split a SoilProfileCollection into a list based on types of horizon logic errors

Description

Uses checkHzDepthLogic() to identify presence of depth logic errors, same depths, missing depths, and overlaps/gaps between the horizons of each profile in a SoilProfileCollection.

Usage

splitLogicErrors(object, interact = FALSE, ...)

Value

A named list of SoilProfileCollections (or NULL), with names: "depthLogic", "sameDepth", "missingDepth", "overlapOrGap". If interact = TRUE then the list elements groups determined by interaction() of the error types.

Arguments

object

A SoilProfileCollection

interact

Calculate interaction between the four logic errors for groups? Default: FALSE always returns 4 groups, one for each logic error type.

...

Additional arguments to split.default, called when interact = TRUE

Examples

Run this code

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

# no errors (all four list elements return NULL)
splitLogicErrors(sp4)

# NA in top depth triggers depth logic and missing depth errors
data(sp4)
sp4$top[1] <- NA
depths(sp4) <- id ~ top + bottom

splitLogicErrors(sp4)

# interact = TRUE gets errors for profile 1 in same group
#  and allows you to pass extra arguments to split.default()
splitLogicErrors(sp4, interact = TRUE, sep = "_", drop = TRUE)

Run the code above in your browser using DataLab