View source: R/DiameterCorrection.R
DiameterCorrectionByTree | R Documentation |
DiameterCorrectionByTree
DiameterCorrectionByTree(
DataTree,
Data,
DefaultHOM = 1.3,
MaxDBH = 500,
PositiveGrowthThreshold = 5,
NegativeGrowthThreshold = -2,
Pioneers = NULL,
PioneersGrowthThreshold = 7.5,
WhatToCorrect = c("POM change", "punctual", "shift"),
CorrectionType = "individual",
DBHRange = 10,
MinIndividualNbr = 5,
OtherCrit = NULL,
Digits = 1L,
coef = 0.9,
DetectOnly = FALSE
)
DataTree |
A dataset corresponding to a single tree/stem's (1 IdTree/IdStem) measurements (data.frame or data.table). |
Data |
Complete dataset (data.table) used if the "phylogenetic hierarchical" correction (CorrectionType argument) is chosen. The dataset must contain the columns:
|
DefaultHOM |
Default Height Of Measurement in meter (Default: 1.3 m) (numeric, 1 value) |
MaxDBH |
Maximum possible DBH of your stand in cm (numeric, 1 value) |
PositiveGrowthThreshold |
in cm/year: a tree widening by more than x cm/year is considered abnormal (numeric, 1 value) |
NegativeGrowthThreshold |
in cm/census: the possible positive measurement error (+n) cannot be corrected until the growth appears abnormal, but a negative measurement error can be allowed until -n (a tree does not decrease). Thus the positive measurement error (+n) is "compensated". (numeric, 1 value) |
Pioneers |
Scientific names of the pioneer species of the site, as in the 'ScientificNameCor' column (characters vector) |
PioneersGrowthThreshold |
in cm/year: a tree of a pioneer species that widens by more than x cm/year is considered abnormal (numeric, 1 value) |
WhatToCorrect |
c("POM change", "punctual", "shift") (character)
|
CorrectionType |
Possible values: "individual", "phylogenetic hierarchical" (character).
|
DBHRange |
DBH range in cm to take into account to select other trees in the dataset to apply "phylogenetic hierarchical" correction (Default: 10 cm) (numeric, 1 value) |
MinIndividualNbr |
Minimum number of individuals to take into account in "phylogenetic hierarchical" correction (Default: 5) (numeric, 1 value) |
OtherCrit |
Other criteria to select the individuals used for the calculation of the mean growth in the "phylogenetic hierarchical" correction. Give the name of the column(s) for which the individuals must have the same value as the tree to correct (e.g. c("Plot", "Subplot")) (character) |
Digits |
Number of decimal places to be used in the 'DBHCor' column (Default: 1L) (integer) |
coef |
description... (numeric) |
DetectOnly |
TRUE: Only detect errors, FALSE: detect and correct errors (Default: FALSE) (logical) |
When there is only 1 Diameter
value for a tree/stem, DBHCor
takes the original Diameter
value. If this value is 0 or > MaxDBH,
DBHCor
takes NA.
Fill the Comment column with error type informations. If DetectOnly = FALSE, add columns:
DBHCor: corrected trees diameter at default HOM
DiameterCorrectionMeth = "local linear regression"/"weighted mean"/phylogenetic hierarchical("species"/"genus"/"family"/"stand")/"shift realignment"/"Same value".
library(data.table)
data(TestData)
DataTree <- data.table(IdStem = "c",
ScientificName = "A",
Year = c(seq(2000,2008, by = 2), 2012, 2014,2016, 2020), # 9 Diameter values
Diameter = c(13:16, 16-4, (16-4)+2, (16-4)+3, 15-4, (15-4)+2), # 0.5 cm/year
POM = as.factor(c(0, 0, 0, 0, 1, 1, 1, 2, 2)))
Rslt <- DiameterCorrectionByTree(
DataTree, TestData,
WhatToCorrect = c("POM change", "punctual", "shift"),
CorrectionType = c("linear", "individual")
)
setnames(Rslt, "POMCor", "POM_TreeDataCor")
DiameterCorrectionPlot(Rslt, CorCol = "DBHCor")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.