PlotDataToLong: Convert Plot data to a data.frame/data.table format

Description Usage Arguments Value Examples

View source: R/PlotDataToLong.R

Description

It attemps to convert the plot level information to a data.frame/data.list format. For example, if management is an element of the plot list (pd) it will melt it to a long format.

Usage

1

Arguments

pd

A list with plot information. It especifically looks for two elements 'stand.age.years' and 'management'.

Value

It returns a data.table with all vector from pd as columns, and dataframes melted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(sitree)

result.sitree <- 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 = 5,
                         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",per.vol.harv = 0.83)

PlotDataToLong(result.sitree$plot.data)

sitreeE documentation built on Nov. 24, 2021, 1:13 a.m.