trunc is a wrapper method around glomApply for the case when the same top and bottom depth is required for all profiles in a collection. In contrast, glomApply allows for arbitrary functions to be run on each profile to calculate a unique set of depths.

# S4 method for SoilProfileCollection
trunc(x, z1, z2)

Arguments

x

A SoilProfileCollection

z1

Upper boundary

z2

Lower boundary

Value

A SoilProfileCollection truncated to interval [z1, z2]

Examples


# load sample data
data("sp3")

# promote to SPC
depths(sp3) <- id ~ top + bottom

### TRUNCATE all profiles in sp3 to [0,25]

# set up plot parameters
par(mfrow=c(2,1), mar=c(0,0,0,0))

# full profiles
plot(sp3)

# trunc'd profiles
plot(trunc(sp3, 0, 25))