height.korf {sitree} | R Documentation |
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.
height.korf(common.vars, this.period, tr, dbh.inc.mm, ...)
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 |
A vector with tree heights increments in dm.
Clara Anton Fernandez caf@nibio.no
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
)
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))