Skip to contents

This function checks a list of species names against the Red Book of Endemic Plants of Peru database and provides information about whether a species was recorded as endemic, its current taxonomic status, and checks for misspelling typos (fuzzy match).

Usage

check_redbook(splist, tax_status = FALSE, max_distance = 0)

Arguments

splist

A character vector containing the species names to be checked.

tax_status

Logical value indicating whether to provide taxonomic status information. If TRUE, it will provide taxonomic status information. If FALSE, it will provide endemism information.

max_distance

Maximum allowed distance for fuzzy matching of species names.

Value

A character vector with information about the taxonomic status or endemism of the provided species names.

Details

This function checks each species name in the provided list against the Red Book of Endemic Plants of Peru database. It performs fuzzy matching based on the specified maximum distance. The output could inform about taxonomic status: a) "Accepted name" if the input names recorded are valid, b) "Updated name", when the input name is currently a synonym, c) "No opinion", if the current taxonomic status of the input name is undefined, and d) "No info. available" for species names recorded in the Red Book that couldn't be found in the WCVP database for name status validation. The output name for this group of species is the name recorded in the original publication.

     The output also returns information about possible misspelling,
     adding "fuzzy match" to the output when a typo is found.

Examples


# Example usage of the function
splist <- c("Aphelandra cuscoenses", "Sanchezia capitata",
            "Sanchezia ovata", "Piper stevensi",
            "Verbesina andinaa", "Verbesina andina")

result_tax <- check_redbook(splist, tax_status = TRUE)
print(result_tax)
#> [1] "Aphelandra cuscoenses - Not endemic"  
#> [2] "Sanchezia ovata - Updated name"       
#> [3] "Sanchezia ovata - Not endemic"        
#> [4] "Piper stevensi - Not endemic"         
#> [5] "Verbesina andinaa - Not endemic"      
#> [6] "Verbesina andina - No info. available"

result_endemism <- check_redbook(splist, tax_status = FALSE)
print(result_endemism)
#> [1] "Not endemic" "Endemic"     "Not endemic" "Not endemic" "Not endemic"
#> [6] "Endemic"