Learn R Programming

TapeS (version 0.14.1)

tprAssortment: Functions to calculate assortments for given tree

Description

Function calculates assortments for given tree according to assortment specification

Usage

tprAssortment(obj, pars = NULL, mono = TRUE, Rfn = NULL)

# S4 method for tprTrees tprAssortment(obj, pars = NULL, mono = TRUE, Rfn = NULL)

Value

a data.frame with columns tree: tree identifier, sort: assortment name, height: beginning of assortment along trunk, length: length of assortment, mdm: mid-diameter of assortment, zdm: top-diameter of assortment and vol: volume.

Arguments

obj

an object of class 'tprTrees'

pars

parameters to specify assortments, see parSort

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)

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

Examples

Run this code
## conifer wood
obj <- tprTrees(spp=c(1, 8),
                Dm=list(30, 40),
                Hm=list(1.3, 1.3),
                Ht=c(30, 40))
tprAssortment(obj)
pars <- parSort(stH=0.2, Lxh=c(1, 1.5), fixN=2, fixL=4)
(ass <- tprAssortment(obj, pars))
plot(obj, assort = ass)

## new possibility: variable fixed length assortments
m <- matrix(c(rep(5, length(obj)),
              rep(3, length(obj))), nrow = 2, byrow = TRUE)
pars <- parSort(fixN=3, fixM = m, fixA=10, fixZ=20)
(ass <- tprAssortment(obj, pars))
plot(obj, assort = ass)

## deciduous wood
obj <- tprTrees(spp=c(15),
                Dm=list(40),
                Hm=list(1.3),
                Ht=c(40))
tprAssortment(obj)
pars <- parSort(n=length(obj), Lxh=c(1), Hsh=10, Az=10)
ass <- tprAssortment(obj, pars)
plot(obj, assort=ass)


## new possibility: variable fixed length assortments
m <- matrix(c(rep(5, length(obj)),
              rep(3, length(obj))), nrow = 2, byrow = TRUE)
pars <- parSort(fixN=3, fixM = m, fixA=10, fixZ=20)
(ass <- tprAssortment(obj, pars))
plot(obj, assort = ass)

Run the code above in your browser using DataLab