Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trunc-SoilProfileCollection-method

Truncate a SoilProfileCollection to specified top and bottom depth


Description

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.

Usage

## S4 method for signature '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))

aqp

Algorithms for Quantitative Pedology

v1.29
GPL (>= 3)
Authors
Dylan Beaudette [aut, cre], Pierre Roudier [aut, ctb], Andrew Brown [aut, ctb]
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.