
Sanitising functions
sanitise_name.RdFunctions to clean and standardise taxonomic names and authors.
Usage
sanitise_name(taxon_name)
sanitise_authors(taxon_authors)
sanitise_names_authors(
taxon_names,
taxon_authors = NA,
taxon_names_full = NA,
console_message = FALSE
)
sanitise_names_authors_report(
collection,
taxon_name_column = "TaxonName",
taxon_name_full_column = NA,
taxon_author_column = NA,
console_message = FALSE
)Arguments
- taxon_name
The taxonomic name of a plant.
Vector of taxonomic authors.
- taxon_names
Vector of taxonomic names.
- taxon_names_full
Vector of joined taxonomic name and author.
- console_message
Flag (TRUE/FALSE) for showing progress bar in the console.
- collection
A data frame of a collection.
- taxon_name_column
The name of the column in the
collectioncorresponding to taxonomic names.- taxon_name_full_column
The name of the column in the
collectioncorresponding to joined taxonomic names and authors.The name of the column in the
collectioncorresponding to the authors of the taxonomic names.
Details
sanitise_name() returns the sanitised name of a single taxonomic name.
sanitise_authors() returns the sanitised name of a taxonomic authors. Where by characters are coerced to Latin-ASCII, thereby removing diacritics (e.g umlauts).
clean_names_authors() sanitises multiple taxonomic names with or without the corresponding authors, by applying sanitise_name() and sanitise_authors(). As input a vector of taxonomic names is required (taxon_names), in addition a vector of the authors (taxon_authors) or joined taxonomic name and authors (taxon_names_full) can be provided. If neither taxon_authors or taxon_names_full are provided the author names are set to ''. A list is returned where:
$taxon_namea vector of the sanitised taxonomic names,$authora vector of the sanitised authors,$sanitisedis a logical vector of whether the taxon_name was sanitised.
clean_names_authors_report() applies clean_names_authors() to a collection where the inputs are:
a data frame of the collection (
collection),column name for the taxonomic names (
taxon_name_column, required),column name of the authors of the taxonomic names (
taxon_author_column, optional),column name of the combined taxonomic name and author (
taxon_name_full_column, optional).
Examples
sanitise_name('TRIGONELLA afghanica')
#> [1] "Trigonella afghanica"
sanitise_name('Halimium X pauanum')
#> [1] "Halimium × pauanum"
sanitise_name('Aruncus dioicus var acuminatus')
#> [1] "Aruncus dioicus var. acuminatus"
sanitise_authors('Stehlé')
#> [1] "Stehle"
taxon_names = c('TRIGONELLA afghanica', 'Halimium X pauanum',
'Aruncus dioicus var acuminatus', 'Eupatorium magdalenae')
taxon_authors = c('Vassilcz', 'Font Quer', '(Douglas ex Hook.) H.Hara', 'Stehlé')
sanitise_names_authors(taxon_names, taxon_authors)
#> $taxon_name
#> [1] "Trigonella afghanica" "Halimium × pauanum"
#> [3] "Aruncus dioicus var. acuminatus" "Eupatorium magdalenae"
#>
#> $author
#> [1] "Vassilcz" "Font Quer"
#> [3] "(Douglas ex Hook.) H.Hara" "Stehle"
#>
#> $sanitised
#> [1] TRUE TRUE TRUE FALSE
#>
collection = data.frame(names = taxon_names, full = paste0(taxon_names, ' ', taxon_authors))
sanitise_names_authors_report(collection, taxon_name_column = 'names',
taxon_name_full_column = 'full')
#> $taxon_name
#> [1] "Trigonella afghanica" "Halimium × pauanum"
#> [3] "Aruncus dioicus var. acuminatus" "Eupatorium magdalenae"
#>
#> $author
#> [1] "Vassilcz" "Font Quer"
#> [3] "(Douglas ex Hook.) H.Hara" "Stehle"
#>
#> $sanitised
#> [1] TRUE TRUE TRUE FALSE
#>