search_mtsta {mtsta}R Documentation

Search for Matching Species Names in the Red List of Montane Tree Species of the Tropical Andes

Description

This function searches for matching species names in the Red List of Montane Tree Species of the Tropical Andes (mtsta package) based on a provided list of species names. The function performs approximate matching using the Levenshtein distance algorithm to find similar names within a specified maximum distance.

Usage

search_mtsta(splist, max_distance = 0.1, ...)

Arguments

splist

A character vector containing the species names to be matched.

max_distance

The distance used is a generalized Levenshtein distance that indicates the total number of insertions, deletions, and substitutions allowed to match the two names. It can be expressed as an integer or as the fraction of the binomial name. A value between 0 and 1 will be treated as a percentage of the string length. A value greater than 1 will be treated as an absolute number of allowed changes. For example, a name with length 10, and a max_distance = 0.1, allow only one change (insertion, deletion, or substitution). A max_distance = 2, allows two changes.

...

Additional arguments (currently unused).

Value

A data frame with the following columns:

If no match is found, the name_matched column will contain "nill", and the other columns will be empty.

See Also

mtsta::mtsta_tab

Examples

# Assuming you have the mtsta package loaded with the necessary data
search_result <- search_mtsta(c("Aphelandra acantasa",
                                "Saurauia lehmani",
                                "Saurauia bullosaa",
                                "Schinus meyerii",
                                "Ilex colombiana",
                                "Ilex rimbachii",
                                "Ilex scopulorum"),
                              max_distance = 0.1)


[Package mtsta version 0.0.0.1 Index]