Learn R Programming

aqp (version 0.99-8.1)

ca630: Soil Data from the Central Sierra Nevada Region of California

Description

Site and laboratory data from soils sampled in the central Sierra Nevada Region of California.

Usage

data(ca630)

Arguments

source

http://ssldata.nrcs.usda.gov/

Details

These data were extracted from the NSSL database. `ca630` is a list composed of site and lab data, each stored as dataframes. These data are modeled by a 1:many (site:lab) relation, with the `pedon_id` acting as the primary key in the `site` table and as the foreign key in the `lab` table.

Examples

Run this code
# 1. check structure
data(ca630)
str(ca630)

# 2. extract site data and convert to SPDF
site <- ca630$site
coordinates(site) <- ~ lon + lat

# 3. aggregate CEC 7 for all profiles into 1 cm slices
# note intermediate steps... will be cleaned-up in AQP 1.0
lab <- ca630$lab
lab$prop <- lab$CEC_7
lab$id <- factor(lab$pedon_id)
s1 <- soil.slot(data=lab)

# 4. plot median & IQR by 1 cm slice
xyplot(top ~ p.q50 + p.q25 + p.q75, 
data=s1, type='S', horizontal=TRUE, col=1, lty=c(1,2,2), 
panel=panel.superpose, ylim=c(150,-5))

# 5. safely compute hz-thickness weighted mean CEC (pH 7)
lab.agg.cec_7 <- ddply(lab, .(pedon_id), 
.fun=summarise, CEC_7=wtd.mean(CEC_7, weights=bottom-top))

# do something with the aggregated data now...

Run the code above in your browser using DataLab