Skip to contents

This function will take a vector of binomial names with various qualifiers of open nomenclatures, and removes them form the vector entries. Only the the genus and species names will remain.

Usage

cleansp(
  x,
  debug = FALSE,
  collapse = "_",
  subgenera = TRUE,
  misspells = TRUE,
  stems = TRUE
)

Arguments

x

(character): the vector containing species names with qualifiers of open taxonomy.

debug

(logical): FALSE will return the cleaned species name vector, TRUE returns a data table that allows one by one checking.

collapse

(character): This argument will be passed to the paste function's argument of the same name. The character value to be inserted between the genus and species names.

subgenera

(logical): FALSE omits subgenus information (in parentheses) and will construct a unique binomen based on the genus and species names alone. TRUE (default) will promote the subgenus names and it will create a new binomen based on the subgenus rather than the genus name.

misspells

logical: Resolution of common spelling mistakes, such as diphtongs and alternate spellings: 'ue' is replaced with 'u', 'ae' is replaced with 'e', 'll' with 'l', 'ss' with 's'and 'y' with 'i'.

stems

(logical): Setting this to TRUE will omit the adjective declination suffices from the species names.

Value

A data.frame or character vector.

Details

This version will keep subgenera, and will not assign species to the base genus. The following qualifiers will be omitted: "n.", "sp.", "?", "gen.", "aff.", "cf.", "ex gr.", "subgen.", "spp" and informal species designated with letters. Entries with "informal" and "indet." in them will also be invalidated.

Author

Adam T. Kocsis, Gwenn Antell. Adam T. Kocsis wrote the main body of the function, subroutines called by the misspells and stems are the modified work of Gwen Antell.

Examples

examp <- c("Genus cf. species", "Genus spp.", "Family indet.", 
  "Mygenus yourspecies", "Okgenus ? questionsp", 
  "Genus (cf. Subgenus) aff. species")
cleansp(examp) 
#>       Genus_species                <NA>                <NA> Mygenus_yourspecies 
#>       "Genus_speci"                  NA                  NA "Migenus_iourspeci" 
#>  Okgenus_questionsp    Subgenus_species 
#> "Okgenus_qustionsp"    "Subgenus_speci"