View source: R/TwoValDiameterCor.R
TwoValDiameterCor | R Documentation |
Correction of 2 diameter values
TwoValDiameterCor(
DataTree,
Data,
DBHCor,
Time,
CorrectionType = NULL,
PositiveGrowthThreshold = 5,
NegativeGrowthThreshold = -2,
DBHRange,
MinIndividualNbr,
OtherCrit,
DetectOnly = FALSE
)
DataTree |
A dataset corresponding to a single tree/stem's (1 IdTree/IdStem) measurements (data.table) If 'phylogenetic hierarchical' correction is asked, the dataset must contain the columns:
|
Data |
Complete dataset (data.table) The dataset must contain the columns:
|
DBHCor |
Diameter vector in cm (numeric) |
Time |
Time vector in years (numeric) |
CorrectionType |
Possible values:
|
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) |
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. 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) |
DetectOnly |
TRUE: Only detect errors, FALSE: detect and correct errors (Default: FALSE) (logical) |
List of 2 objects:
DBHCor (numeric vector): corrected by the method
DataTree (data.table): with the DiameterCorrectionMeth column filled with correction method.
library(data.table)
data(TestData)
DataTree <- TestData[IdTree %in% "100771"]
DataTree <- DataTree[order(Year)] # order de dt
DataTree$Diameter <- c(NA, 13, NA, 8, NA)
DBHCor <- DataTree$Diameter
Time <- DataTree$Year
TwoValDiameterCor(DataTree,
Data = TestData,
DBHCor, Time,
CorrectionType = "phylogenetic hierarchical",
DBHRange = 10,
MinIndividualNbr = 1, OtherCrit = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.