sitree2dataframe: sitree2data.frame and sitree2dataframe.all

Description Usage Arguments Details Value Author(s) Examples

View source: R/sitree2dataframe.R

Description

sitree2data.frame converts trList and trListDead class objects to data.frames. sitree2data.frame converts all output of sitree to a data.frame

Usage

1
2

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

 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
32
33
34
35
36
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

cantonfe/sitree documentation built on Dec. 26, 2021, 8:55 a.m.