calc_soil_trapezoidal: Calculate weighted average of soil column based on...

View source: R/calc_soil_trapezoidal.R

calc_soil_trapezoidalR Documentation

Calculate weighted average of soil column based on trapezoidal rule

Description

The purpose of this function is to calculate the weighted average of a soil property across a soil column over standard depth intervals. This function is designed to work on 4 depth breaks. This uses the trapezoidal rule as described in Hengl et al. (2017, https://doi.org/10.1371/journal.pone.0169748).

Usage

calc_soil_trapezoidal(
  depth1 = 0,
  depth2 = 5,
  depth3 = 15,
  depth4 = 30,
  value1,
  value2,
  value3,
  value4
)

Arguments

depth1

Numeric. Depth of top soil column interval. Defaults to 0 cm.

depth2

Numeric. Depth of second from top soil column interval. Defaults to 5 cm.

depth3

Numeric. Depth of third from top soil column interval. Defaults to 15 cm.

depth4

Numeric. Depth of bottom soil column interval. Defaults to 30 cm.

value1

Numeric. Value of the soil property at depth1.

value2

Numeric. Value of the soil property at depth2.

value3

Numeric. Value of the soil property at depth3.

value4

Numeric. Value of the soil property at depth4.

Value

Numeric. Weighted mean of soil values.


annack84/STMdevelopment documentation built on April 12, 2024, 6:46 p.m.