## 1. test validity methods
# this should work fine
data(sp1)
depths(sp1) <- id ~ top + bottom
# horizon logic can be tested via data.frame and
# test_hz_logic(i, topcol, bottomcol, test.NA=TRUE, strict=FALSE)
# these next examples should throw an error
# insert a missing horizon boundary
data(sp1)
sp1$top[1] <- NA
depths(sp1) <- id ~ top + bottom
# insert a bogus horizon boundary
## NOTE: this is currently valid, as this check breaks slice(SPC, ...)
data(sp1)
sp1$top[2] <- 30
depths(sp1) <- id ~ top + bottom
Run the code above in your browser using DataLab