unroll {aqp} | R Documentation |
Generate a descretized vector of genetic horizons along a user-defined pattern.
unroll(top, bottom, prop, max_depth, bottom_padding_value = NA, strict=FALSE)
top |
vector of upper horizon boundaries, must be an integer |
bottom |
vector of lower horizon boundaries, must be an integer |
prop |
vector of some property to be "unrolled" over a regular sequence |
max_depth |
maximum depth to which missing data is padded with NA |
bottom_padding_value |
value to use when padding missing data |
strict |
should horizons be strictly checked for self-consistency? defaults to FALSE |
This function is used internally by several higher-level components of the aqp
package. Basic error checking is performed to make sure that bottom and top horizon boundaries make sense. Note that the horizons should be sorted according to depth before using this function. The max_depth
argument is used to specifiy the maximum depth of profiles within a collection, so that data from any profile shallower than this depth is padded with NA.
a vector of "unrolled" property values
Dylan E. Beaudette
http://casoilresource.lawr.ucdavis.edu/
data(sp1)
# subset a single soil profile:
sp1.1 <- subset(sp1, subset=id == 'P001')
# demonstrate how this function works
x <- with(sp1.1, unroll(top, bottom, prop, max_depth=50))
plot(x, 1:length(x), ylim=c(90,0), type='b', cex=0.5)