if (FALSE) {
library(aqp)
library(soilDB)
library(latticeExtra)
data("ROSETTA.centroids")
# iterate over horizons and generate VG model curve
res <- lapply(1:nrow(ROSETTA.centroids), function(i) {
m <- KSSL_VG_model(VG_params = ROSETTA.centroids[i, ], phi_min = 10^-3, phi_max=10^6)$VG_curve
# copy generalized hz label
m$hz <- ROSETTA.centroids$hz[i]
# copy ID
m$texture_class <- ROSETTA.centroids$texture[i]
return(m)
})
# copy over lab sample number as ID
res <- do.call('rbind', res)
# check: OK
str(res)
# visual check: OK
xyplot(
phi ~ theta | texture_class, data=res,
type=c('l', 'g'),
scales=list(alternating=3, x=list(tick.number=10), y=list(log=10, tick.number=10)),
yscale.components=yscale.components.logpower,
ylab=expression(Suction~~(kPa)),
xlab=expression(Volumetric~Water~Content~~(cm^3/cm^3)),
par.settings = list(superpose.line=list(col='RoyalBlue', lwd=2)),
strip=strip.custom(bg=grey(0.85)),
as.table=TRUE
)
}
Run the code above in your browser using DataLab