ropensci / taxlist

Handling taxonomic lists
https://docs.ropensci.org/taxlist/
12 stars 4 forks source link

Match names #16

Closed kamapu closed 2 years ago

kamapu commented 2 years ago

Description

Implementing a new parameter in function match_names() for a sorting of the output table using the 'character,taxlist-method'. The parameter sort_by can be set with a character vector indicating, which columns in the output table should be considered for the sorting. In an additional parameter order_args() a list of further arguments can be provided, which will be passes to the function order().

Related Issue

This pull request is related to #8.

Example

library(taxlist)

Spp <- c("Cyperus papirus", "Thypha dominguez", "Eichhornia crassipes")

# Unsorted output
match_names(Spp, Easplist)

# Sorting by names
match_names(Spp, Easplist, sort_by = "TaxonName")

# Decreasing sorting by similarity
match_names(Spp, Easplist, sort_by = "similarity", order_args = list(decreasing = TRUE))