knitr::opts_chunk$set(echo = TRUE)
devtools::load_all()
library(knitr)

0. Installing and loading package

remotes::install_github("liibre/Rocc")
library(Rocc)

1. String check

The function check_status makes preliminary check in a scientific name, catching most common errors in species names such as:

species <- c("Lindsaea lancea var. falcata", "Asplenium Aff. truncorum", 
             "Aspidosperma discolor", "Aspidosperma Discolor", 
             "Aspidosperma discolor A.DC.", "Aspidosperma cf. discolor", 
             "Aspidosperma CF. discolor", "Aspidosperma aff. discolor",
             "Aspidosperma Aff. discolor", "Aspidosperma sp. discolor", 
             "Aspidosperma cf.discolor", "Aspidosperma dicolor", 
             "Apocynaceae Aspidosperma", "Aspidosperma cf. discolor A.DC.", 
             "Aspidosperma aff. discolor A.DC.", "Aspidosperma discolor A. & DC.", 
             "Asplenium sp.", "Asplenium sp 2", 
             "Asplenium sp. nov. truncorum", "Asplenium truncorum 2", 
             "cf. Piper dilatatum", "Piper dilatatum sp. nov.", 
             "aff. Piper dilatatum", "Miconia albicans (Sw.) Triana", 
             "Miconia albicans (Sw.) TRIana", "Bowlesia incana f. crassifolia", 
             "Gleicheniales", "Entrophospora R.N. Ames & R.W. Schneid. 1979",
             "Chamissoa acuminata Mart. var. acuminata", "incertae sedis", 
              "Schinopsis brasiliensis var. glabra Engl.", "Byrsonima rich.",
             "Peronospora hyoscyami f. sp. tabacina Skalický", "Bla bla Fulano f.", 
             "Syagrus ×andrequiceana", "Agalinis itambensisxangustifolia?", 
              "Morganella rimosa Baseia & Alfredo sp. nov.", "S polyphylla", 
             "Leandra euphorbioides (Naudin) D`El Rei Souza & Baumgratz", 
             "Cyrtocymura harleyi (H.Rob.) H.Rob.", "Metrodorea mollis",
             "Phaseolus robustus Piper", "Catasetum ×splendens Cogn.", 
             "Catasetum ×evangelistae V.P.Castro & G.F.Carr", "Helietta glaziovii",
             "Drosera ×fontinalis Rivadavia", "Diplazium lepthochlamys", 
             "Salvinia ×delasotae C.V. Miranda & Schwartsb.", "Anemia x elephantensis", 
             "Abutilon bedfordianum discolor", "Bauhinia ungulata cuiabensis", 
             "Cf. Lagenocarpus cf. rigidus", "Lychnophora staavioides aff. uniflora",
             "Pityrogramma] calomelanos calomelanos", "Chamaecrista asplenüplia", 
             "Myrcia multifloravar.glaucensis")

df <- check_string(species)

Checking the output of check_string()

kable(df[order(df$speciesStatus, df$species), ], row.names = FALSE)

Now getting only possible correct and unique names.

ok <- c("variety", 
        "possibly_ok", 
        "name_w_wrong_case",
        "name_w_authors")

df_ok <- df[df$speciesStatus %in% ok, ]

species_new <- unique(df_ok$species)

2. Taxonomic check

First, we will check for typos and get a list of possible names.

suggest_taxa <- suggest_flora(species_new)
search_taxa <- na.omit(as.character(unique(suggest_taxa$species)))
list_taxa <- lapply(search_taxa, check_flora)

Output

Still deciding the output. The columns synonym and scientificName_search were added by hand inside function, other columns are exactly the same as in the API of Brazilian Flora 2020.

Lindsaea lancea

# L. lancea
list_taxa[[1]]$taxon
list_taxa[[1]]$synonyms

Aspidosperma discolor

# para A. discolor
list_taxa[[2]]$taxon
list_taxa[[2]]$synonyms


saramortara/rocc documentation built on April 3, 2022, 3:41 p.m.