Learn R Programming

taxlist (version 0.2.3)

match_names: Search matchings between character and taxlist objects

Description

Names provided in a character vector will be compared with names stored in slot taxonNames within an object of class taxlist by using the function stringsim().

Usage

match_names(x, object, ...)

# S4 method for character,character match_names(x, object, best = 5, clean = TRUE, decreasing = TRUE, ...)

# S4 method for character,taxlist match_names( x, object, clean = TRUE, output = "data.frame", best = 5, show_concepts = FALSE, accepted_only = FALSE, method = "lcs", sort_by, order_args = list(), ... )

Arguments

x

A character vector with names to be compared.

object

An object of class taxlist to be compared with.

best

Integer value indicating how many from the best matches have to be displayed (only working for output="list").

clean

Logical value, whether leading, tailing and double blanks should be deleted from x.

decreasing

Logical value indicating whether retrieved names should be sorted by decreasing or increasing similarity value. In the character method, the sorting corresponds to similarities between the queried value and the reference vector (argument object). In the taxlist method using 'output = "data.frame'", the order corresponds to the similarity of the best match (by default, no sorting is done). This argument is passed to order().

output

Character value indicating the type of output. Alternative values are "list" (taxon concepts ID's sorted by similarity for each queried name) or "data.frame" (a table including the best match for every queried name).

show_concepts

Logical value, whether respective concepts should be displayed in output or not.

accepted_only

Logical value, whether only accepted names should be matched or all usage names (including synonyms).

method, ...

Further arguments passed to stringsim().

sort_by

A character vector including the output columns used for sorting the output table. Used only in 'character,taxlist-method'. The function checks the presence of these values as columns in the output data frame.

order_args

A named list including arguments passed to order() in the 'character,taxlist-method'.

Author

Miguel Alvarez kamapu78@gmail.com

See Also

stringsim()

Examples

Run this code
## Names to be compared
species <- c("Cperus papyrus", "Typha australis", "Luke skywalker")

## Comparing character vectors
match_names("Cyperus paper", species)

## Retrieve taxon usage names
match_names(species, Easplist)

## Display accepted names in output
match_names(x = species, object = Easplist, show_concepts = TRUE)

Run the code above in your browser using DataLab