Title: | Sitree Extensions |
---|---|
Description: | Provides extensions for package 'sitree' for allometric variables, growth, mortality, recruitment, management, tree removal and external modifiers functions. |
Authors: | Clara Anton Fernandez [aut, cre] |
Maintainer: | Clara Anton Fernandez <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0-8 |
Built: | 2024-11-08 03:11:25 UTC |
Source: | https://github.com/cran/sitreeE |
Implementation of models for climate-sensitive site index models for Norway as described in Antón-Fernández et al. (2016).
AM2016ClimateSensitiveSINorway(soilquality, t.early.summer, waterbal, SI.spp)
AM2016ClimateSensitiveSINorway(soilquality, t.early.summer, waterbal, SI.spp)
soilquality |
A factor with levels 1 to 5 indicating the soilquality category. 1 being the poorest soils and 5 the best soils |
t.early.summer |
A vector with sum temperatures (in C) in spring and early summer (april, june and july) |
waterbal |
A vector with the montly moisture surplus in June (difference between the 30-year mean precipitation in June and mean potential evapotranspiration in June.). |
SI.spp |
SI species, that is, the species for which SI should be calculated. 1 = spruce, 2 = pine, 3 = birch. |
Returns a vector with the estimated SI.
Clara Anton-Fernandez
Anton-Fernandez, Clara, Blas Mola-Yudego, Lise Dalsgaard, and Rasmus Astrup. 2016. “Climate-Sensitive Site Index Models for Norway.” Canadian Journal of Forest Research 46 (6). doi: 10.1139/cjfr-2015-0155
AM2016ClimateSensitiveSINorway (soilquality = as.factor(c(1,2,3,4)), t.early.summer = c(10,20,30,10), waterbal = c(-40, 20,10,10), SI.spp = c(1,2,2,3))
AM2016ClimateSensitiveSINorway (soilquality = as.factor(c(1,2,3,4)), t.early.summer = c(10,20,30,10), waterbal = c(-40, 20,10,10), SI.spp = c(1,2,2,3))
Implements Marklund's (1988) biomass equations for above-ground biomass and Petersson and Ståhl (2006) for below-ground biomass.
biomass.spruce.M1988(dbh.cm, H.m) biomass.pine.M1988(dbh.cm, H.m) biomass.birch.M1988(dbh.cm, H.m)
biomass.spruce.M1988(dbh.cm, H.m) biomass.pine.M1988(dbh.cm, H.m) biomass.birch.M1988(dbh.cm, H.m)
dbh.cm |
A vector with the dbh (diameter at breast height) of the trees, in cm. |
H.m |
A vector with the heights of the trees, in meters. |
It returns a data.frame with the following biomass components in kg: living.branches, dead.branches, stem.wood, stump.roots, bark, usoil, rot1, rot2, and foliage.
Clara Anton Fernandez [email protected]
Marklund, L. G. 1988. “Biomassafunktioner för tall, gran och björk i Sverige [Biomass functions for pine, spruce and birch in Sweden].” Report 45. Umeå, Sweden: Swedish University of Agricultural Sciences. Department of Forest Survey. Petersson, Hans, and Göran Ståhl. 2006. “Functions for Below-Ground Biomass of Pinus Sylvestris, Picea Abies, Betula Pendula and Betula Pubescens in Sweden.” Scandinavian Journal of Forest Research 21 (S7): 84–93.
biomass.spruce.M1988(dbh.cm = c(10, 20), H.m = c(8, 12))
biomass.spruce.M1988(dbh.cm = c(10, 20), H.m = c(8, 12))
Implements biomass functions for birch for Norway from Smith et al (2014, 2016). Total biomass aboveground does include stump calculated using biomass.birch.M1988. Total biomass belowground does not include stump.
biomass.birch.S2014(dbh.cm, H.m)
biomass.birch.S2014(dbh.cm, H.m)
dbh.cm |
dbh (diameter at breast height) in cm. |
H.m |
Tree height in meters. |
It uses stump.roots from biomass.birch.M1988 to calculate aboveground biomass (in kg) and belowground biomass (in kg). Aboveground biomass is calculated as Smith's aboveground biomass (2014) + stump.roots. Belowground biomass is calcualted as Smith's belowground biomass (2016) - stump.roots.
Returns a data.frame with the following biomass components: biomass.total.kg, biomass.aboveground.kg.S2014, biomass.belowground.kg.S2014, biomass.belowground.kg, biomass.aboveground.kg, living.branches, dead.branches, stem.wood, stump.roots, bark, usoil, rot1, rot2, foliage)
Clara Anton Fernandez ([email protected])
Smith, Aaron, Aksel Granhus, and Rasmus Astrup. 2016. “Functions for Estimating Belowground and Whole Tree Biomass of Birch in Norway.” Scandinavian Journal of Forest Research 31 (6): 568–82. https://doi.org/10.1080/02827581.2016.1141232 Smith, Aaron, Aksel Granhus, Rasmus Astrup, Ole Martin Bollandsås, and Hans Petersson. 2014. “Functions for Estimating Aboveground Biomass of Birch in Norway.” Scandinavian Journal of Forest Research 29 (6): 565–78. http://dx.doi.org/10.1080/02827581.2014.951389
biomass.birch.S2014(dbh.cm = c(10, 20), H.m = c(12, 16))
biomass.birch.S2014(dbh.cm = c(10, 20), H.m = c(12, 16))
Calculates biomass for trees using the Norwegian biomass equations.
biomass.norway.sitree(dbh.mm, height.dm, tree.sp)
biomass.norway.sitree(dbh.mm, height.dm, tree.sp)
dbh.mm |
Diameter at breast height in mm. |
height.dm |
Tree height in dm. |
tree.sp |
Tree species according to the Norwegian NFI. It will use
|
Returns a data.table containing the 12 columns resulting from applying the biomass functions.
biomass.birch.S2014
, biomass.pine.M1988
, biomass.spruce.M1988
bio.nor <- biomass.norway.sitree (dbh.mm = c(50, 60, 100 ), height.dm = c(40, 60, 80), tree.sp = c(1, 10, 30))
bio.nor <- biomass.norway.sitree (dbh.mm = c(50, 60, 100 ), height.dm = c(40, 60, 80), tree.sp = c(1, 10, 30))
Calculates biomass for trees using the Norwegian biomass equations.
biomass.sitree(tr, plot.data)
biomass.sitree(tr, plot.data)
tr |
A trList or trListDead object. |
plot.data |
A data.frame or list with plot information. It should have at least plot.id and tree2ha. |
Returns a data.table containing the 12 columns resulting from applying the biomass functions.
Clara Anton Fernandez [email protected]
biomass.birch.S2014
, biomass.birch.M1988
,
biomass.pine.M1988
, biomass.spruce.M1988
, biomass.norway.sitree
library(sitree) result.sitree <- sitree (tree.df = stand.west.tr, stand.df = stand.west.st, functions = list( fn.growth = 'grow.dbhinc.hgtinc', fn.mort = 'mort.B2007', fn.recr = 'recr.BBG2008', fn.management = NULL, fn.tree.removal = NULL, fn.modif = NULL, fn.prep.common.vars = 'prep.common.vars.fun' ), n.periods = 20, period.length = 5, mng.options = NA, print.comments = FALSE, fn.dbh.inc = "dbhi.BN2009", fn.hgt.inc = "height.korf" ) biom <- biomass.sitree(tr = result.sitree$live, plot.data = result.sitree$plot.data)
library(sitree) result.sitree <- sitree (tree.df = stand.west.tr, stand.df = stand.west.st, functions = list( fn.growth = 'grow.dbhinc.hgtinc', fn.mort = 'mort.B2007', fn.recr = 'recr.BBG2008', fn.management = NULL, fn.tree.removal = NULL, fn.modif = NULL, fn.prep.common.vars = 'prep.common.vars.fun' ), n.periods = 20, period.length = 5, mng.options = NA, print.comments = FALSE, fn.dbh.inc = "dbhi.BN2009", fn.hgt.inc = "height.korf" ) biom <- biomass.sitree(tr = result.sitree$live, plot.data = result.sitree$plot.data)
It calculates the mean height of the X tallest trees by grouping variable (e.g. the plot ID)
height.of.X.tallest.trees(height, uplotID, num.trees)
height.of.X.tallest.trees(height, uplotID, num.trees)
height |
A vector with heights |
uplotID |
A vector with the grouping variable, most often this would be the plot ID. |
num.trees |
Number of trees used to calculate the mean height. |
It returns a data.frame with two columns containing the uplotID and the mean height of the X tallest trees.
This function can be used to calculate the average of the X largest
values of any variable grouped by a grouping variable. It is mostly a
wrapper for aggregate
.
Clara Antón Fernández ([email protected])
library(sitree) height.of.X.tallest.trees(height = tr$height, uplotID = tr$plot.id, 5)
library(sitree) height.of.X.tallest.trees(height = tr$height, uplotID = tr$plot.id, 5)
Calculates Lorey's height (mean height weigted by basal area). If group.id is not NULL, it will calculate Lorey's height for each group.
lorey.height(BA, height, group.id = NULL)
lorey.height(BA, height, group.id = NULL)
BA |
A vector with the basal areas of the trees |
height |
A vector with the height of the trees |
group.id |
An optional vector with a grouping variable. |
If a grouping variable is provided it returns a data frame with two columns (group.id, and lorey.height). If a grouping variable is not provided it will return the Lorey's height.
Clara Anton Fernandez ([email protected])
library(sitree) BA <- pi*(tr$dbh/2)^2 lorey.height(BA, tr$height) lorey.height(BA, tr$height, tr$plot.id)
library(sitree) BA <- pi*(tr$dbh/2)^2 lorey.height(BA, tr$height) lorey.height(BA, tr$height, tr$plot.id)
It calculates the basal area of larger trees for a plot.
PBAL(BA)
PBAL(BA)
BA |
A vector of tree's basal area. |
It returns a vector with the sum of the basal areas of larger trees. Trees with similar BA are not considered larger.
PBAL(c(1,2,3,4,4))
PBAL(c(1,2,3,4,4))
Calculates the basal area (in cm2 if dbh is in mm) of trees that are at least X (in the same units as dbh) larger than the tree of interest for a list of trees.
PBAL.dbh.greater(dbh.mm, dbh.mm.diff)
PBAL.dbh.greater(dbh.mm, dbh.mm.diff)
dbh.mm |
a vector of dbh in mm |
dbh.mm.diff |
minimum dbh difference between the tree and the tree of interest to be considered |
It estimates the basal area (in cm2) of trees that are at least dbh.mm.diff mm larger than the tree of interest.
It returns a list with the basal area of larger trees.
Cara Antón-Fernández (email: [email protected])
library(sitree) PBAL.dbh.greater(c(100,89,51,74,4), 3) aggregate(dbh ~ plot.id, data = tr, FUN = PBAL.dbh.greater, dbh.mm.diff = 2)
library(sitree) PBAL.dbh.greater(c(100,89,51,74,4), 3) aggregate(dbh ~ plot.id, data = tr, FUN = PBAL.dbh.greater, dbh.mm.diff = 2)
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.
PlotDataToLong(pd)
PlotDataToLong(pd)
pd |
A list with plot information. It especifically looks for two elements 'stand.age.years' and 'management'. |
It returns a data.table with all vector from pd as columns, and dataframes melted.
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)
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)
Average height of the n thickest trees per ha
top.height(thickness, height, num.trees.per.ha, plot.id, plot.size.m2)
top.height(thickness, height, num.trees.per.ha, plot.id, plot.size.m2)
thickness |
A vector with the thickness for every tree. Other variables can be used instead to thickness. This is only used to order the trees. |
height |
Height of the trees. |
num.trees.per.ha |
Number of trees per ha that the top height should correspond to. E.g. 100 trees per ha. |
plot.id |
Vector with the plot.id to which every tree corresponds to. |
plot.size.m2 |
Plot size in square meters. It can be either a single number if all plots have the same size of a vector of equal length as thickness, height, and plot.id with the corresponding plot size for each tree. |
thickness, height, and plot.id should have the same length, that is, one value per tree.
It returns a data.frame with two columns: top.heights in the same units as height, and plot.id.
top.height(thickness = runif(100, 10,40), height = runif(100, 12, 45), num.trees.per.ha = 100, plot.id = 1, plot.size.m2 = 250)
top.height(thickness = runif(100, 10,40), height = runif(100, 12, 45), num.trees.per.ha = 100, plot.id = 1, plot.size.m2 = 250)
Estimates individual tree age of trees within a plot based on basal area, site index, species, and development class.
tree.age(stand.age.years, plot.id, tree.BA.m2, dbh.mm, SI.spp, SI.m, spp, dev.class, apply.correction = TRUE)
tree.age(stand.age.years, plot.id, tree.BA.m2, dbh.mm, SI.spp, SI.m, spp, dev.class, apply.correction = TRUE)
stand.age.years |
The age of the stand in years. |
plot.id |
The unique ID of the stand |
tree.BA.m2 |
A vector with the basal areas of each tree in m2. |
dbh.mm |
A vector with the DBH in mm of each tree. |
SI.spp |
Species for which SI has been calculated (1, 2, 3). |
SI.m |
Site index (SI) in m. |
spp |
Species group classification. |
dev.class |
Development class. |
apply.correction |
TRUE/FALSE. If a correction to age should be applied |
A vector with the estimated ages of trees
Clara Anton Fernandez [email protected]
tree.age(stand.age.years = 40, plot.id = c(1,1), tree.BA.m2 = c(0.05, 0.5),dbh.mm = c(50,150), SI.spp = 2, SI.m = 11, spp = c(1,1), dev.class = 3, apply.correction = TRUE)
tree.age(stand.age.years = 40, plot.id = c(1,1), tree.BA.m2 = c(0.05, 0.5),dbh.mm = c(50,150), SI.spp = 2, SI.m = 11, spp = c(1,1), dev.class = 3, apply.correction = TRUE)
It calculates volume following the Norwegian national forest inventory equations for a trList or trListDead object
volume.sitree(tr, plot.data)
volume.sitree(tr, plot.data)
tr |
a trListDead or trList object |
plot.data |
a list or data.frame containing at least a 'kom' and 'tree2ha' column/element. kom is the kommune (municipality) code, and tree2ha should be the expansion factor to go from tree to per ha basis. |
It uses the volume.norway function to estimate the volume for all trees with dbh.mm greater than 0. It returns NA when dbh.mm is 0 or lower. tree2ha is included to facilitate the calculation of per ha values.
It returns a data.table with columns for treeid, plot.id, dbh.mm, height.dm, kom, tree2ha, tree.sp, vol.w.tr.m3 (volume with bark in m3 per tree), and vol.wo.tr.m3 (volume without bark in m3 per tree)
Clara Antón-Fernández (email: [email protected])
library(sitree) 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 = 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 ) volume.sitree(tr = res$live, plot.data = res$plot.data)
library(sitree) 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 = 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 ) volume.sitree(tr = res$live, plot.data = res$plot.data)