Search Species Distribution of A Regional Red List of Montane Tree Species of the Tropical Andes
Source:R/search_mtsta_distribution.R
search_mtsta_distribution.Rd
This function searches the Montane Tree Species of the Tropical Andes distribution database for a list of submitted species names and returns their distribution information. The search allows for approximate string matching within a given maximum distance.
Arguments
- splist
Character vector of submitted plant species names for which distribution data is to be searched.
- max_distance
Numeric value representing the maximum allowed distance for approximate string matching. The default value is 0.1.
- typedf
"main" return a selected columns in from mtsta_distribution "full" return all data
Value
A data frame with the following columns:
- name_submitted
Character vector with the submitted species names.
- name_matched
Character vector with the matched species names in the database.
- accepted_name
Character vector with the accepted names of the matched species.
- distribution
Character vector with the distribution of the matched species.
- unsure_distribution
Character vector with information about unsure distribution (if available).
- distribution_wcvp
Character vector with the distribution from the World Check-list of Vascular Plants (WCVP) database for the matched species.
- taxonomic_status
Character vector indicating the taxonomic status of the matched species.
- distance
Numeric vector with the Levenshtein distance between submitted and matched species names.
Details
The function uses approximate string matching with a maximum distance specified by
the max_distance
argument. It searches the mtsta
distribution database for submitted
species names that match the provided names within the given distance. The function then
retrieves distribution information, including the accepted name, distribution region, unsure
distribution (if available), distribution from the World Check-list of Vascular Plants (WCVP),
taxonomic status, and the Levenshtein distance between submitted and matched species names.
Examples
# Example usage of search_mtsta_distribution function
species_list <- c("Escallonia mirtilloydes", "Ilex rimbachii", "Saurauia lehmannii")
distribution_data <- search_mtsta_distribution(species_list, max_distance = 0.2)
print(distribution_data)
#> name_submitted name_matched accepted_name
#> 1 Escallonia mirtilloydes Escallonia myrtilloides Escallonia myrtilloides
#> 2 Ilex rimbachii Ilex rimbachii Ilex rimbachii
#> 3 Saurauia lehmannii Saurauia lehmannii Saurauia lehmannii
#> distribution_wcvp
#> 1 Argentina - Bolivia - Colombia - Costa Rica - Ecuador - Panama - Peru - Venezuela
#> 2 Ecuador - Peru
#> 3 Colombia - Ecuador
#> taxonomic_status distance
#> 1 Accepted 2
#> 2 Accepted 0
#> 3 Accepted 0