Learn R Programming

aqp (version 1.8-6)

SoilProfileCollection-class: SoilProfileCollection Class

Description

Basic class for storing soil profile collections, associated site data, and metadata.

Arguments

Objects from the Class

Objects can be created by calls of the form new("SoilProfileCollection", ...).

Examples

Run this code
# concatenate SoilProfileCollection objects
require(plyr)
d <- ldply(1:10, random_profile)

# promote to SoilProfileCollection and plot
depths(d) <- id ~ top + bottom
plot(d)

# split into new SoilProfileCollection objects by index
d.1 <- d[1, ]
d.2 <- d[2, ]
d.345 <- d[3:5, ]

# recombine, note that profiles are sorted according to ID
d.new <- rbind(d.345, d.1, d.2)
plot(d.new)

# these next examples should throw an error
# insert a missing horizon boundary
data(sp1)
sp1$top[1] <- NA
depths(sp1) <- id ~ top + bottom

Run the code above in your browser using DataLab