View source: R/DiameterCorrection.R
DiameterCorrection | R Documentation |
Diameter correction
DiameterCorrection(
Data,
KeepMeas = c("MaxHOM", "MaxDate"),
DefaultHOM = 1.3,
MaxDBH = 500,
PositiveGrowthThreshold = 5,
NegativeGrowthThreshold = -2,
Pioneers = NULL,
PioneersGrowthThreshold = 7.5,
WhatToCorrect = c("POM change", "punctual", "shift"),
CorrectionType = c("individual", "phylogenetic hierarchical"),
DBHRange = 10,
MinIndividualNbr = 5,
OtherCrit = NULL,
Digits = 1L,
DBHCorForDeadTrees = TRUE,
coef = 0.9,
DetectOnly = FALSE
)
Data |
Dataset (data.frame or data.table) The dataset must contain the columns:
|
KeepMeas |
In case of multiple diameter measurements in the same census year: Possible values: "MaxHOM", "MaxDate" (character).
|
DefaultHOM |
Default Height Of Measurement in meter (Default: 1.3 m) (numeric, 1 value) |
MaxDBH |
Maximum possible DBH (Diameter at the default HOM) of your stand in cm (numeric, 1 value) |
PositiveGrowthThreshold |
in cm/year: a tree widening by more than this value 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 |
PioneersGrowthThreshold |
in cm/year: a tree of a pioneer species that widens by more than this value is considered abnormal (numeric, 1 value) |
WhatToCorrect |
Possible values: "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 |
DBHCorForDeadTrees |
(logical) TRUE: return DBHCor also for dead trees. FALSE: do not return DBHCor for dead trees. In this case it is advisable to have corrected the tree life status with the StatusCorrection() function. |
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,
Diameter_TreeDataCor
takes the original Diameter
value. If this value
is 0 or > MaxDBH, Diameter_TreeDataCor
takes NA. Diameters not linked to
an IdTree/IdStem or to a Census Year are not processed.
Punctual error correction only with linear regression and not quadratic,
because punctual errors are corrected from a local regression with the 2
framing values.
Fill the Comment column with error type informations. If DetectOnly = FALSE, add columns:
Diameter_TreeDataCor: corrected trees diameter at default HOM
DiameterCorrectionMeth = "local linear regression","weighted mean"/phylogenetic hierarchical("species"/"genus"/"family"/"stand")/ "shift realignment"/"Same value".
POM_TreeDataCor (factor): POM value at which the corrected diameters are proposed. Corresponds to the 1st POM value at which the stem was measured.
HOM_TreeDataCor (numeric): HOM value at which the corrected diameters are proposed. Corresponds to the 1st HOM value at which the stem was measured.
library(data.table)
data(TestData)
Rslt <- DiameterCorrection(
TestData,
WhatToCorrect = c("POM change", "punctual", "shift"),
CorrectionType = c("linear", "individual"),
MinIndividualNbr = 1, Digits = 2L)
DiameterCorrectionPlot(Rslt, OnlyCorrected = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.