Description Usage Arguments Details Value Examples
This function ensures site names conform to a controlled vocabulary. It compares a vector of names to a thesaurus of variant names, misspellings and character encoding inconsistencies and replaces matches with a canonical form.
1 | swap_control_site_name(x, quiet = FALSE)
|
x |
Character vector of site names. |
quiet |
Logical. If |
Elements of x
are matched to the site name thesaurus using the following
rules (in order of priority):
Exact match to a variant name in the thesaurus
Plain text match to a thesaurus variant, allowing for substitution or omission of non-ASCII characters (e.g. "Catalhoyuk" → "Çatalhöyük"), punctuation (e.g. "Baja" → "Ba'ja"), or whitespace (e.g. "El-Wad" → "El Wad").
Ambiguous site names—elements of x
that match multiple thesaurus entries—
will cause an error.
x
with elements matched to the thesaurus replaced by their canonical forms.
Unless quiet = TRUE
, the function also prints a list of values that were
changed. A warning will be issued if elements of x
were not matched to the
thesaurus (regardless of the quiet
argument).
1 2 | sites <- c("Catalhoyuk", "Tepe Ganj Dareh", "Jericho")
swap_control_site_name(sites)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.