depths<-,SoilProfileCollection-method | R Documentation |
Initialize a SoilProfileCollection from a data.frame object
## S4 replacement method for signature 'SoilProfileCollection' depths(object) <- value ## S4 replacement method for signature 'data.frame' depths(object) <- value
object |
An object to promote to SoilProfileCollection (inherits from data.frame) |
value |
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.