BotanicalCorrection: Botanical Correction

View source: R/BotanicalCorrection.R

BotanicalCorrectionR Documentation

Botanical Correction

Description

Botanical Correction

Usage

BotanicalCorrection(Data, Source = NULL, WFOData = NULL, DetectOnly = FALSE)

Arguments

Data

Dataset (data.frame or data.table) The dataset must contain the columns:

  • IdTree (character)

  • Family (character)

  • Genus (character)

  • Species (character)

  • VernName (character)

  • ScientificName (character)

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)

DetectOnly

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

Details

  • No special characters (typography)

  • No family name in the Genus and Species columns (the suffix "aceae" is specific to the family name.

  • Correct spelling of botanical names (Taxonstand or WorldFlora)

  • Family & Scientific names match (BIOMASS::getTaxonomy or WorldFlora)

  • Update the scientific botanical names with the current phylogenetic classification

  • Check invariant botanical informations per IdTree (1 IdTree = 1 family, 1 scientific and 1 vernacular name)

Value

Fill the Comment column with error type informations. If DetectOnly = FALSE, add columns:

  • Family_TreeDataCor (character): corrected Family name

  • FamilyCorSource (character): source of the Family correction

  • Genus_TreeDataCor (character): corrected Genus name

  • Species_TreeDataCor (character): corrected Species name

  • BotanicalCorrectionSource (character): source of the Genus and Species correction

  • ScientificName_TreeDataCor (character): corrected Scientific name

  • VernName_TreeDataCor (character): completed if information available at IdTree level.

Examples

## Not run: 
library(data.table)
data(TestData)

# With The Plant List:
Rslt <- BotanicalCorrection(TestData, Source = "TPL")

ScfcCor <- unique(Rslt[ScientificNameCor != ScientificName,
                list(ScientificName, ScientificNameCor,
                Family, FamilyCor, FamilyCorSource,
                Genus, GenusCor,
                Species, SpeciesCor, Subspecies,
                BotanicalCorrectionSource, Comment)
                ])

FamCor <- unique(Rslt[FamilyCor != Family,
                list(ScientificName, ScientificNameCor,
                Family, FamilyCor, FamilyCorSource,
                Genus, GenusCor,
                Species, SpeciesCor, Subspecies,
                BotanicalCorrectionSource, Comment)
                ])

# With World Flora Online:
WFO_Backbone <- file.choose()
load(WFO_Backbone)

RsltWFO <- BotanicalCorrection(TestData, Source = "WFO", WFOData = WFO_Backbone)

ScfcCor <- unique(RsltWFO[ScientificNameCor != ScientificName,
                list(ScientificName, ScientificNameCor,
                Family, FamilyCor,
                Genus, GenusCor,
                Species, SpeciesCor, Subspecies,
                BotanicalCorrectionSource, Comment)
                ])

FamCor <- unique(RsltWFO[FamilyCor != Family,
                list(ScientificName, ScientificNameCor,
                Family, FamilyCor,
                Genus, GenusCor,
                Species, SpeciesCor, Subspecies,
                BotanicalCorrectionSource, Comment)
                ])

## End(Not run)


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