TPLck2 | R Documentation |
TPLck
indicating the number of homonyms of a taxon name
A modified version of the TPLck
function from package Taxonstand
. The function basically provides the same information than TPLck
, but further keeps track of homonyms. Although a warning message indicates in TPLck
when there are several homonyms, the function returns the first homonym in alphabetic order only.
TPLck2
returns the number of homonyms for a given taxon name.
TPLck2(sp, corr = TRUE, diffchar = 2, max.distance = 1, infra = TRUE, abbrev = TRUE, version = "1.1", encoding = "UTF-8")
sp |
a character vector specifying the input taxon, i.e. genus and specific epithet and, potentially, author name and infraspecific abbreviation and epithet. |
corr |
logical. If TRUE (default), spelling errors are corrected (only) in the specific and infraspecific epithets prior to taxonomic standardization. |
diffchar |
a number indicating the maximum difference between the number of characters in corrected and original taxon names. Not used if corr = FALSE. |
max.distance |
a number indicating the maximum distance allowed for a match in agrep when performing corrections of spelling errors in specific epithets. Not used if corr = FALSE. |
infra |
logical. If TRUE (default), infraspecific epithets are used to match taxon names in TPL. |
abbrev |
logical. If 'TRUE' (default), abbreviations (aff., cf., subsp., var.) and their variants are removed prior to taxonomic standardization. |
version |
a character vector indicating whether to connect to the newest version of TPL (1.1) or to the older one (1.0). Default to "1.1". |
encoding |
encoding to be assumed for input strings from TPL website; defaults to "UTF-8" (see |
TPLck2
overcomes two issues in TPLck
. First, valid homonyms (i.e., a name for a taxon that is identical in spelling to another such name, but belongs to a different taxon) cannot be identified.
Second, if the infraspecific epithet does not match any of the infraspecific epithets considered in TPL, then the first accepted name with no infraspecific epithet is selected as the best match. If all names provided by TPL have infraspecific epithets and are all synonyms (e.g. Pottia starkeana), then there is no best match and the output will match the original name.
The function return an object of class data.frame
including the same elements than those provided by TPLck
, plus the element $Homonym
indicating the number of homonyms if any.
The value of $Homonym
is NA
if there is no homonym.
V. Raevel, adapted from Luis Cayuela & Jari Oksanen
TPLck
## Not run: Taxonstand::TPLck("Acacia sundra") test <- TPLck2("Acacia sundra") test ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.