trias-project / unified-checklist

🇧🇪 Global Register of Introduced and Invasive Species - Belgium
https://trias-project.github.io/unified-checklist/
MIT License
0 stars 1 forks source link

Function verify_synonyms() #2

Closed peterdesmet closed 5 years ago

peterdesmet commented 6 years ago
verify_synonyms <- function(
    taxa = NULL # Dataframe with taxa to verify
    verified_synonyms = NULL # Dataframe with verified synonym info
)

Parameters

taxa: a dataframe with at least the following columns

verified_synonyms: a dataframe with at least the following columns

Functionality (pseudo code):

if in verified_synonyms:
     if taxa.backbone_scientificName != verified_synonyms.backbone_scientificName:
        update in verified_synonyms
        add to updated_scientificName
    if taxa.backbone_accepted != verified_synonyms.backbone_accepted:
        update in verified_synonyms
        add to updated_accepted
    else
        do nothing
else (not in verified_synonyms):
    add to verified_synonyms
    add to new_synonyms

if in verified_synonyms, but not in taxa:
    add to unused_synonyms

Return

Documentation

peterdesmet commented 5 years ago

This function exists in the trias package and is performing well. Thanks @damianooldoni!