
depths(<data.frame>) <- <formula>
: Initialize SoilProfileCollection
depths(<SoilProfileCollection>)
: Extract profile ID and horizon depths from SoilProfileCollection
# S4 method for SoilProfileCollection
depths(x, hzID = FALSE, ...)# S4 method for SoilProfileCollection
depths(object) <- value
# S4 method for data.frame
depths(object) <- value
a data.frame
containing profile ID, top depth, and bottom depth
A SoilProfileCollection
Include horizon ID? Usually this is calculated from the (sorted) row index unless hzidname()<-
has been called. Default: FALSE
not used
An object to promote to SoilProfileCollection (inherits from data.frame)
A formula specifying the unique profile ID, top and bottom depth column names
The input horizon data, and the resulting profile order, is sorted based on unique profile ID and top depth. ID columns are converted to character, depth columns are converted to integer. If NA
values exist in all of the top depths, a prototype with 1 horizon per profile ID is returned, with NA
in all non-essential columns. If the input object
has 0 rows, a prototype with 0 horizons and 0 rows, but same column names as object
, is returned.
horizons()
idname()
hzidname()
horizonDepths()
# load a SoilProfileCollection
data(jacobs2000, package = "aqp")
depths(jacobs2000)
## init SoilProfileCollection objects from data.frame of horizon data
# load demo data
data(sp1)
# promote to SPC
depths(sp1) <- id ~ top + bottom
# plot
plot(sp1)
# number of profiles
length(sp1)
# number of horizons
nrow(sp1)
Run the code above in your browser using DataLab