Learn R Programming

biometrics (version 1.0.3)

cubica: Compute taper volume

Description

Performs the cubication of taper data. If the data corresponds to a full tree, and pred == FALSE the calculation is performed as a cilinder for the stump, smalian for each section in the stem and a cone for the crown. Otherwise, just smalian is used and a sum is performed up to the corresponding heights.

Usage

cubica(
  dl,
  hl,
  hstump = NA,
  htop = NA,
  dlu = NA,
  hlu = NA,
  full.tree = TRUE,
  pred = FALSE,
  rel.vol = c(25, 30, 40, 50, 90),
  ...
)

Value

A list with data.frames with the different volumes calculated.

Arguments

dl

vector of diameters. Has to have the same length as hl

hl

vector of heights. Has to have the same length as dl

hstump

a numeric value indicating the stump height. If missing and pred == FALSE it defaults to the height of the first section.

htop

a numeric value indicating the height to crown base. If missing and pred == FALSE it defaults to the height of the next to last section.

dlu

numeric values indicating comercial diameters. If the values doesn't exists in the data they are interpolated via datana::interp.

hlu

numeric values indicating comercial heights. If the values doesn't exists in the data they are interpolated via datana::interp.

full.tree

wheter the data comes from a full tree having stump, stemp and crown (TRUE, default) or just stem data (FALSE).

pred

wheter the data comes from measured data (FALSE, default) or from predicted values (TRUE).

rel.vol

numerical values of relative volumes, used to compute the corresponding height and diameter.

...

optional parameters to pass to datana::interp().

Author

Christian Salas-Eljatib and Nicolás Campos

Examples

Run this code
if (FALSE) {
## generating suitable data
df <- data.frame(dl = c(31.1, 25.8, 21.2, 19.6, 17.9, 15.9, 13.5,  9.8,  7.3, 0),
                 hl = c(0.30, 0.80, 1.30, 4.88, 9.76, 12.20, 14.64, 19.52, 24.40, 31.1),
                 hstump = c(0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30),
                 htop = c(24.40, 24.40, 24.40, 24.40, 24.40, 24.40, 24.40, 24.40, 24.40, 24.40))
df

cubica(dl = df$dl,
       hl = df$hl,
       hstump = unique(df$hstump),
       htop = unique(df$htop))

## adding commercial volumes
cubica(dl = df$dl,
       hl = df$hl,
       dlu = c(20, 15, 21.2),
       hstump = unique(df$hstump),
       htop = unique(df$htop))
}

Run the code above in your browser using DataLab