Learn R Programming

TapeS (version 0.13.3)

tprVolume: Functions to calculate stem volume from taper curve

Description

Function calculates stem volume from taper curve for given trees, depending definition of segment and on bark indicator. It is possible to request confidence or prediction intervals.

Usage

tprVolume(
  obj,
  AB = NULL,
  iAB = NULL,
  bark = NULL,
  interval = "none",
  mono = TRUE,
  Rfn = NULL
)

# S4 method for tprTrees tprVolume( obj, AB = list(A = 0, B = 7, sl = 2), iAB = c("h", "dob"), bark = TRUE, interval = "none", mono = TRUE, Rfn = NULL )

Value

if interval='none' a vector else a matrix.

Arguments

obj

object of class 'tprTrees'

AB

list with heights or diameters A and B of section for which volume over or under bark should be calculated. Additionally, add in sl for the segment length over which the integral should be calculated. See details.

iAB

character indicating how to interpret given A and B values. Either "H" (height), "Dob" (diameter over bark) or "Dub" (diameter under bark). Could be of length one or two, depending on whether A and B are both height or diameter variables or not. Default is c("h", "dob"). See examples.

bark

should volume be returned including (TRUE) or excluding bark (FALSE)?

interval

character to indicate whether and which type of interval is required; one of none, confidence or prediction.

mono

logical, defaults to true. If calibrated taper curve is non-monotonic at stem base, a support diameter is added.

Rfn

Rfn setting for residuals error matrix, defaults to list(fn="sig2"), see resVar.

Methods (by class)

  • tprVolume(tprTrees): method for class 'tprTrees'

Details

The function returns total solid wood w/ bark (i.e. from H=0 to D=7cm) by default. Using AB, one can specify lower A and upper B end of segments for which volume is required, w/ or w/o bark. If B <= A, which can unconsciously happen if one is given as height and the other as diameter, B is silently set to A resulting in a zero estimate. This is reasonable in all cases: if both A and B are given as height or diameter and if they are given in a mixed way (height and diameter), since the upper bound should never be below the lower end.

iAB can be a vector of length two, indicating how to interpret A and B. Hence, one can calculate volume between a given height and a given diameter, either over or under bark. If of length one, it is assumed that the indicator applies to both A and B.

Defining interval 'confidence' or 'prediction' returns lower (lwr) and upper (upr) interval bounds on confidence level \(\alpha\) = qt(0.025, ...). NB: The volume confidence bounds only incorporate the uncertainty of diameter estimation at a pre-fixed position (e.g. H=1.3m). If the position is given as diameter (e.g. iAB="Dob"), the absolute height position is calculated using the *estimated* diameter, hence, the uncertainty of the estimated absolute height is not (yet) included. Neither is the uncertainty of the models for bark reduction.

In contrast to the underlying R-package TapeR, which uses E_VOL_AB_HmDm_HT.f for volume calculation, this function calculates volume based on stem-section (default: 2m, see parameter AB). Additionally, with that approach, bark reduction is easily possible.

See Also

E_DHx_HmDm_HT.f for the underlying diameter calculation.

Examples

Run this code
obj <- simTrees() # default is: simulate 10 Norway spruce with mean dbh of 40
A <- 1
B <- 10
tprVolume(obj) # default is: coarse wood volume w/ bark
tprVolume(obj, AB = list(A=A, B=B, sl=2), iAB = "H", bark=FALSE)
tprVolume(obj, AB = list(A=A, B=B, sl=0.01), iAB = "H", bark=FALSE)
tprVolume(obj, AB = list(A=A, B=B, sl=0.01), iAB = "H", bark=TRUE)

## compare against integrated taper curve volume via package TapeR
## TapeR integrates over the taper curve, while TapeS uses segments of length 'sl'
SKP <- TapeS:::SKPar
TapeR::E_VOL_AB_HmDm_HT.f(Hm=obj@Hm[[1]], Dm = obj@Dm[[1]], iDH = "H",
                          mHt = obj@Ht[1], sHt = 0, A = A, B = B,
                          par.lme=SKP[[1]])$E_VOL

## returning intervals
tprVolume(obj, interval="none")
tprVolume(obj, interval="confidence")
tprVolume(obj, interval="prediction")
tprVolume(obj, interval="prediction", bark=FALSE)
tprVolume(obj, interval="prediction", AB=list(A=0.1, B=5.1, sl=0.1), iAB="H")

Run the code above in your browser using DataLab