Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

horizons

Retrieve horizon data from SoilProfileCollection


Description

Get horizon data from SoilProfileCollection. Result is returned in the same data.frame class used to initially construct the SoilProfileCollection.

Horizon data in an object inheriting from data.frame can easily be added 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: horizons(spc) <- newdata

Arguments

object

A SoilProfileCollection

value

An object inheriting data.frame

Examples

# load test data
data(sp2)

# promote to SPC
depths(sp2) <- id ~ top + bottom

# assign true to surface horizon
newdata <- data.frame(top = 0,
                      newvalue = TRUE)

# do left join
horizons(sp2) <- newdata

# inspect site table: newvalue TRUE only for horizons
#  with top depth equal to zero
horizons(sp2)

aqp

Algorithms for Quantitative Pedology

v1.29
GPL (>= 3)
Authors
Dylan Beaudette [aut, cre], Pierre Roudier [aut, ctb], Andrew Brown [aut, ctb]
Initial release
2021-04-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.