namesCompare: Checking species names for misspelling and synonyms

View source: R/namesCompare.R

namesCompareR Documentation

Checking species names for misspelling and synonyms

Description

The function cross-references two vectors of species names checking for possible synonyms, misspelled names, and genus-species or species-subspecies correspondence.

Usage

namesCompare(vec1,vec2,proportion=0.15)

Arguments

vec1, vec2

a vector of species names. Genus names only are also allowed. Generic name and specific epithet must be separated by '_'. Note that vec2 is used as the reference. Incomplete or suspicious names are better placed in vec1 (see example below).

proportion

the maximum proportion of different characters between any vec1-vec2 names pair to consider it a possible misspelling.

Value

The function returns a list including:

$genus if vec1 includes genera names which miss specific epithet, this object lists all the species in vec2 belonging to each of the genera.

$subspecies if vec1 includes subspecies (i.e. two epithets after genus name), this object lists species in vec2 possibly corresponding to each of the subspecies.

$epithet lists species with matching epithets as possible synonyms.

$misspelling lists possible misspelled names. For each proposed mismatched names pair the proportion of characters in the vec1 differing from the string in vec2 is returned.

Author(s)

Silvia Castiglione, Carmela Serio, Antonella Esposito

Examples

## Not run: 
names(DataFelids$statefel)->nams
nams[c(19,12,37,80,43)]<-c("Puma_yagouaroundi","Felis_manul","Catopuma",
                           "Pseudaelurus","Panthera_zdansky")
nams<-nams[-81]

namesCompare(nams,names(DataFelids$statefel))
namesCompare(names(DataFelids$statefel),nams)

## End(Not run)

RRphylo documentation built on June 7, 2023, 5:49 p.m.