height.korf: Simple height function

Description Usage Arguments Value Author(s) Examples

View source: R/height.korf.R

Description

A simple tree height function based on tree species, and DBH. It returns the difference between the height at the current period (this.period) and the next period.

Usage

1
height.korf(common.vars, this.period, tr,  dbh.inc.mm, ...)

Arguments

common.vars

A list with at least an element named 'spp' with the species group composition.

this.period

The period for which to calculate the height of the trees.

tr

A trList.

dbh.inc.mm

A vector with the projected dbh increment.

...

Currently not used

Value

A vector with tree heights increments in dm.

Author(s)

Clara Anton Fernandez [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
foo.matrix <-  matrix(0, nrow = length(tr$dbh), ncol = (5 +1))
colnames(foo.matrix) <- paste("t", 0:5, sep = "")
foo.dbh <- foo.height <- foo.matrix
foo.dbh[,1] <- tr$dbh
foo.height[,1] <- tr$height

trl <- list(
  plot.id  = tr$plot.id,
  treeid    = tr$treeid,
  dbh.mm    = foo.dbh,
  height.dm = foo.height,
  yrs.sim   = rep(0, nrow(tr)),
  tree.sp   = factor(tr$tree.sp)
)
tr.i <- trList$new(data = trl, nperiods = as.integer(5))

common.vars <-  prep.common.vars.fun(
  tr = tr.i,
  fl = fl,
  this.period    = "t0",
  i.period       = 0,
  common.vars    = "NULL",
  mng.options    = NA,
  vars.required  = c("spp"),
  period.length = 5,
  species.spruce = c(1, 2, 3),
  species.pine = c(10, 11, 20, 21, 29),
  species.harw = c(30, 31)
)
height.korf(common.vars = common.vars$res, this.period = 't0', 
    tr.i, fl, dbh.inc.mm = runif(nrow(tr.i$data$dbh.mm), 5, 80)) 

sitree documentation built on July 5, 2017, 9:02 a.m.