h <- data.frame(
id = 1,
hzname = c("A", "BA", "Bw", "BC", "C"),
top = c(0, 10, 45, 60, 90),
bottom = c(10, 45, 60, 90, 150),
clay = c(15, 16, 45, 20, 10),
sand = c(10, 35, 40, 50, 90),
frags = c(0, 5, 10, 38, 40)
)
h <- cbind(h,
texcl = ssc_to_texcl(clay = h$clay, sand = h$sand))
pscs <- data.frame(id = 1,
top = 25,
bottom = 100)
h <- cbind(h,
taxpartsize = texture_to_taxpartsize(
texcl = h$texcl,
clay = h$clay,
sand = h$sand,
fragvoltot = h$frags
))
depths(h) <- id ~ top + bottom
# set required metadata for estimatePSCS()
hzdesgnname(h) <- "hzname"
hztexclname(h) <- "texcl"
hzmetaname(h, "clay") <- "clay"
pscs <- data.frame(id = h$id, rbind(estimatePSCS(h)))
names(pscs)[2:3] <- c("top", "bottom")
hz_to_taxpartsize(horizons(h), pscs)
Run the code above in your browser using DataLab