The function cross-references two vectors of species names checking for possible synonyms, misspelled names, and genus-species or species-subspecies correspondence.
namesCompare(vec1,vec2,proportion=0.15)
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.
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).
the maximum proportion of different characters between any
vec1-vec2
names pair to consider it a possible misspelling.
Silvia Castiglione, Carmela Serio, Antonella Esposito
if (FALSE) {
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)
}
Run the code above in your browser using DataLab