Get site data from SoilProfileCollection. Result is returned in the same
data.frame class used to initially construct the SoilProfileCollection.
There are two options available via the
The first is a "normalization" by formula interface, whereby one specifies an attribute that is constant in horizons within profiles to be promoted to a site-level variable:
site(spc) <- ~ horizonvariable
The second is creation of site data from an external
data.frame via merge (LEFT JOIN). There must be one or more same-named columns (with at least some matching data) on the left and right hand side to facilitate the join:
site(spc) <- newdata
1 2 3 4
A formula or object inheriting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# load test data data(sp2) # promote to SPC depths(sp2) <- id ~ top + bottom # normalize a horizon-level attribute to site site(sp2) <- ~ surface # inspect site table site(sp2) # make some data: classify two geomorphic surfaces with numeric value newdata <- data.frame(surface = c("holocene", "lower riverbank"), newvalue = c(1,2)) # do left join based on newly-normalized "surface" attribute site(sp2) <- newdata # inspect site table: holocene & lower riverbank have values site(sp2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.