FullErrorProcessing: Full error processing

View source: R/FullErrorProcessing.R

FullErrorProcessingR Documentation

Full error processing

Description

Full error processing

Usage

FullErrorProcessing(
  Data,
  DetectOnly = FALSE,
  Source = NULL,
  WFOData = NULL,
  InvariantColumns = c("Site", "Genus_TreeDataCor", "Species_TreeDataCor",
    "Family_TreeDataCor", "ScientificName_TreeDataCor"),
  DeathConfirmation = 2,
  UseSize = FALSE,
  RemoveRBeforeAlive = FALSE,
  RemoveRAfterDeath = FALSE,
  DefaultHOM = 1.3,
  TaperParameter = function(DAB, HOM) 0.156 - 0.023 * log(DAB) - 0.021 * log(HOM),
  TaperFormula = function(DAB, HOM, TaperParameter, DefaultHOM) DAB/(exp(-TaperParameter
    * (HOM - DefaultHOM))),
  KeepMeas = c("MaxHOM", "MaxDate"),
  MaxDBH = 500,
  PositiveGrowthThreshold = 5,
  NegativeGrowthThreshold = -2,
  Pioneers = NULL,
  PioneersGrowthThreshold = 7.5,
  WhatToCorrect = c("taper", "POM change", "punctual", "shift"),
  CorrectionType = c("individual", "phylogenetic hierarchical"),
  DBHRange = 10,
  MinIndividualNbr = 5,
  OtherCrit = NULL,
  Digits = 1L,
  DBHCorForDeadTrees = TRUE,
  coef = 0.9,
  MinDBH = 10
)

Arguments

Data

Dataset (data.frame or data.table)

DetectOnly

TRUE: Only detect errors, FALSE: detect and correct errors (Default: FALSE) (logical)

Source

(character) To correct and standardise, you can choose between:

  • "TPL": The Plant List (http://www.theplantlist.org/) (faster but based on the 2013 taxonomy)

  • "WFO": World Flora Online (http://www.worldfloraonline.org/) (long time but based on the 2022 taxonomy)

  • NULL: if only error detection (DetectOnly = TRUE)

WFOData

To be filled in if the argument Source = "WFO". Data set with the static copy of the World Flora Online (WFO) Taxonomic Backbone data (from http://www.worldfloraonline.org/downloadData.) (data.frame or data.table)

InvariantColumns

Vector with the names of the columns that are supposed to have always the same value for each measurement of the same tree (character). It is recommended to use the columns that have already been corrected, such as the columns containing the corrected botanical information.

DeathConfirmation

Number of times (censuses) needed for an unseen tree to be considered dead (numeric) (Default = 2 censuses)

UseSize

Use the size presence as a witness of the living status of the tree (logical) (Default = FALSE)

RemoveRBeforeAlive

Do you want to delete the rows about the tree before it was seen alive for the 1st time? (logical)

RemoveRAfterDeath

After correction do you want to delete the rows concerning the tree after its death? (logical)

DefaultHOM

Default Height Of Measurement in meter (Default: 1.3 m) (numeric, 1 value)

TaperParameter

Taper parameter (unitless) formula (function) Default: TaperParameter = 0.156 - 0.023 log(DAB) - 0.021 log(HOM) of Cushman et al.2021. With:

  • DAB: Diameter Above Buttress (in cm)

  • HOM: Height Of Measurement (in m)

TaperFormula

Taper formula (function) Default: DAB / (e^(- TaperParameter (HOM - DefaultHOM))) of Cushman et al.2021. With:

  • DAB: Diameter Above Buttress (in cm)

  • HOM: Height Of Measurement (in m)

  • DefaultHOM: Default Height Of Measurement (in m)

  • TaperParameter: Taper parameter (unitless)

KeepMeas

In case of multiple diameter measurements in the same census year: Possible values: "MaxHOM", "MaxDate" (character).

  • "MaxHOM": apply the correction to the measurement taken at the highest POM

  • "MaxDate": apply the correction to the most recent measurement (same year but more recent date)

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 ScientificName_TreeDataCor column (characters vector)

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)

  • "POM change": detect POM change in the column POM and correct the Diameter values from it.

  • "punctual": detect if the error is punctual and correct it by interpolation.

  • "shift": detect if there is a shift of several Diameter values and links them to the 1st measurements set.

CorrectionType

Possible values: "individual", "phylogenetic hierarchical" (character).

  • "individual": replace abnormal growth by interpolation from the individual values.

  • "phylogenetic hierarchical": replace abnormal growth with the average growth of other trees in the dataset, at the specific, genus, family or stand level, within a DBH range of x cm (DBHRange argument). If the number of these trees < n (MinIndividualNbr argument) at the specific level, we switch to the genus level etc.

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)

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)

MinDBH

Minimum diameter of trees inventoried according to your protocol (in cm) (numeric, 1 value) (Default = 10 cm)

Details

Detect errors or detect and correct errors:

  • Check general errors (GeneralErrorsDetection)

  • Check botanical identification (BotanicalCorrection)

  • Check the life status evolution of the trees/stems (StatusCorrection)

  • Apply a taper allometry on diameters measured at heights different from the default(TaperCorrection)

  • Check diameter evolution of the trees (DiameterCorrection)

  • Check tree/stem recruitment (RecruitmentCorrection)

Value

The original dataset (data.table) with a Comment column containing information on the errors detected per row, the correction columns, and columns containing correction methods.

See Also

GeneralErrorsDetection, BotanicalCorrection, StatusCorrection, TaperCorrection, DiameterCorrection, RecruitmentCorrection

Examples

data(TestData)
Rslt <- FullErrorProcessing(TestData, DetectOnly = TRUE)

## Not run: 
WFO_Backbone <- file.choose()
load(WFO_Backbone)
Rslt_Test <- FullErrorProcessing(TestData, Source = "WFO", WFOData = WFO_Backbone)
Rslt_Panama <- FullErrorProcessing(PanamaFormated, Source = "WFO", WFOData = WFO_Backbone)

## End(Not run)


VincyaneBadouard/TreeData documentation built on Jan. 4, 2024, 2:56 a.m.