taxlist (version 0.1.7)

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

# S4 method for character,character
match_names(x, object, best=5, clean=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", ...)

Arguments

x

A character vector with names to be compared.

object

An object of class '>taxlist to be compared with.

clean

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

output

Character value indicating the type of output (see details).

best

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

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.

method,...

Further arguments passed to stringsim.

Details

For output="list" a list with the best matches (taxon usage name ID and similarity) for each queried name will be retrieved, where the number is set by argument 'best'.

Option 'accepted_only=TRUE' will only work with 'output="data.frame"'. This will be applied especially in those cases were the requested names have more than one match in the reference '>taxlist object (matching homonyms) and will retrieve the one name, that has the status of accepted name, otherwise no matchings will be retrieved.

See Also

stringsim.

Examples

Run this code
# NOT RUN {
library(taxlist)
data(Easplist)

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

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

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

Run the code above in your browser using DataCamp Workspace