Description Methods Author(s) References Examples
Getters, Setters, and Utility Methods for SoilProfileCollection Objects
signature(object = "SoilProfileCollection")
Dylan E. Beaudette
http://casoilresource.lawr.ucdavis.edu/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | data(sp1)
## init SoilProfileCollection objects from data.frame
depths(sp1) <- id ~ top + bottom
## depth units
(du <- depth_units(sp1))
depth_units(sp1) <- 'in'
depth_units(sp1) <- du
## get/set metadata on SoilProfileCollection objects
# this is a 1-row data.frame
m <- metadata(sp1)
m$sampler <- 'Dylan'
metadata(sp1) <- m
## extract horizon data from SoilProfileCollection objects as data.frame
h <- horizons(sp1)
# also replace horizon data in SoilProfileCollection objects
# original order and length must be preserved!
horizons(sp1) <- h
# get number of horizons
nrow(sp1)
## getting site-level data
site(sp1)
## setting site-level data
# site-level data from horizon-level data (stored in @horizons)
site(sp1) <- ~ group
# make some fake site data, and append from data.frame
# a matching ID column must be present in both @site and new data
# note that IDs should all be character class
d <- data.frame(id=profile_id(sp1), p=runif(n=length(sp1)), stringsAsFactors=FALSE)
site(sp1) <- d
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.