sitree2dataframe {sitree} | R Documentation |
sitree2data.frame and sitree2dataframe.all
Description
sitree2data.frame converts trList and trListDead class objects to data.frames. sitree2data.frame converts all output of sitree to a data.frame
Usage
sitree2dataframe(tr.dt)
sitree2dataframe.all(sitree.res)
Arguments
tr.dt |
A trList or trListDead object. |
sitree.res |
An object resulting from running sitree. |
Details
As implemented, it expects to have a 'removed' element on sitree2dataframe.all. For an alternative when the simulation has no harvest see the exaples below.
Value
sitree2dataframe return a data.frame with dbh, height, and species by period. sitree2dataframe.all returns a list
live |
A data.frame with dbh, height, and species of the trees alive at each period. |
dead |
A data.frame with dbh, height, and species of the trees found dead at each period. |
removed |
A data.frame with dbh, height, and species of the trees removed at each period. |
Author(s)
Clara Anton Fernandez
Examples
n.periods <- 10
# Run a simulation with the example functions
res <- sitree (tree.df = tr,
stand.df = fl,
functions = list(
fn.growth = 'grow.dbhinc.hgtinc',
fn.mort = 'mort.B2007',
fn.recr = 'recr.BBG2008',
fn.management = 'management.prob',
fn.tree.removal = 'mng.tree.removal',
fn.modif = NULL,
fn.prep.common.vars = 'prep.common.vars.fun'
),
n.periods = n.periods,
period.length = 5,
mng.options = NA,
print.comments = FALSE,
fn.dbh.inc = "dbhi.BN2009",
fn.hgt.inc = "height.korf",
species.spruce = c(1, 2, 3),
species.pine = c(10, 11, 20, 21, 29),
species.harw = c(30, 31),
fun.final.felling = "harv.prob",
fun.thinning = "thin.prob",
'BN2009',
'BBG2008', 'SBA.m2.ha', 'spp','pr.spru.ba', 'QMD.cm',
per.vol.harv = 0.83
)
dbh.mm <- sitree2dataframe(res$live)
res.dt <- sitree2dataframe.all(res)
## The function is currently defined as
[Package sitree version 0.1-14 Index]