Description Usage Arguments Details Value Examples
Generates abbreviated site codes from their full names. The codes follow a set pattern designed to be predictable and probably (but not necessarily) unique.
1 | swap_site_code(x, max_length = 4)
|
x |
Character vector of site names. |
max_length |
Numeric. Desired length of the generated codes. Must be
greater than 1. Default: |
swap_site_code()
attempts to generate a fixed-width code consisting of the
abbreviation site name and, if present in the site name, a numeric suffix.
The pattern is determined by the value of the max_length
parameter:
max_length = 2
: AB
or A1
max_length = 3
: ABC
or AB1
max_length = 4
: ABCD
or AB01
(the default)
max_length = 5
: ABCDE
or ABC01
...
A fixed-width output isn't guaranteed, for example if the name of the site
is shorter than max_length
.
As long as they are preceded by a space, Roman numerals up to XXXIX (39) are also recognised as a numeric suffix, and are converted to Arabic numbers.
A character vector of site codes derived from x
.
1 2 | sites <- c("Çatalhöyük", "Chia Sabz", "Azraq 31", "Gilgal I", "Tell es-Sultan")
swap_site_code(sites)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.