carbon_stocks: Calculate soil carbon stocks

View source: R/apsimx_soil_profile.R

carbon_stocksR Documentation

Calculate soil carbon stocks

Description

Calculation of carbon stocks based on an object of class ‘soil_profile’

Usage

carbon_stocks(
  x,
  depth,
  area = c("m2", "ha"),
  method = c("linear", "constant"),
  ...
)

Arguments

x

object of class ‘soil_profile’

depth

soil depth (in meters). If missing then the whole soil profile is used.

area

either ‘m2’ meter squared or ‘ha’.

method

interpolation method. Either ‘linear’ or ‘constant’.

...

additional arguments passed to internal functions (none used at the moment).

Details

Function to calculate carbon stocks. The output units depend on the choice of area. If ‘m2’ is used, then the output units will be ‘kg/m2’. If the ‘area’ is ‘ha’, then the output units will be ‘Mg/ha’.

Value

returns a value with attribute ‘units’ and ‘depth’

Examples

## Not run: 
sp <- apsimx_soil_profile()
carbon_stocks(sp)
carbon_stocks(sp, depth = 0.1)
carbon_stocks(sp, depth = 0.2)
carbon_stocks(sp, depth = 0.3)
carbon_stocks(sp, depth = 0.4)

## End(Not run)

apsimx documentation built on March 18, 2022, 7:52 p.m.