Learn R Programming

aqp (version 0.85)

panel.depth_function: Lattice Panel Function for Soil Profiles

Description

Panel function for plotting grouped soil property data, along with upper and lower estimates of uncertainty.

Usage

panel.depth_function(x, y, upper = NA, lower = NA, 
subscripts = NULL, groups = NULL, ...)

Arguments

x
x values (generated by calling lattice function)
y
y values (generated by calling lattice function)
upper
vector of upper confidence envelope values
lower
vector of lower confidence envelope values
subscripts
paneling indices (generated by calling lattice function)
groups
grouping data (generated by calling lattice function)
...
further arguments to lower-level lattice plotting functions, see below

Details

This function can be used to replace panel.superpose when plotting depth function data.

References

http://casoilresource.lawr.ucdavis.edu/

See Also

sp1

Examples

Run this code
library(lattice)
data(sp1)

# 1. plotting mechanism for step-functions derived from soil profile data
xyplot(cbind(top,bottom) ~ prop, groups=id, data=sp1, 
panel=panel.depth_function, ylim=c(250,-10), 
scales=list(y=list(tick.number=10)), xlab='Property', 
ylab='Depth (cm)', main='Soil Profile Averaging by Slotting',
auto.key=list(columns=3, points=FALSE, lines=TRUE)
)


# 2. plotting upper/lower envelope around some value, by depth:
# profile data are aggregated ("slotted") by 1cm depth slices
a <- soil.slot(sp1)

# manually add mean +/- SD
a$upper <- with(a, p.mean+p.sd)
a$lower <- with(a, p.mean-p.sd)

# use custom plotting function for uncertainty viz.
xyplot(top ~ p.mean, data=a, 
lower=a$lower, upper=a$upper, ylim=c(250,-5), alpha=0.5, 
panel=panel.depth_function, 
prepanel=prepanel.depth_function
)

Run the code above in your browser using DataLab