rand_names | R Documentation |
Randomly generated unique IDs are used throughout the package, created by
rand_names()
. If random strings are required that may not clash with a set
of existing values, this can be guaranteed by passing them as old_names
.
The set of allowed characters can be controlled via chars
and non-random
pre- and suffixes may be specified as prefix
/suffix
arguments, while
uniqueness is guaranteed including pre- and suffixes.
rand_names(
old_names = character(0L),
n = 1L,
length = 15L,
chars = letters,
prefix = "",
suffix = ""
)
old_names |
Disallowed IDs |
n |
Number of IDs to generate |
length |
ID length |
chars |
Allowed characters |
prefix , suffix |
ID pre-/suffix |
A character vector of length n
where each entry contains length
characters (all among chars
and start/end with prefix
/suffix
), is
guaranteed to be unique and not present among values passed as old_names
.
rand_names(chars = c(letters, LETTERS, 0:9))
rand_names(length = 5L)
rand_names(n = 5L, prefix = "pre-", suffix = "-suf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.