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
.
A blockr_option()
rand_id
can be set to swap out the function responsible
for ID generation.
Usage
rand_names(
old_names = character(0L),
n = 1L,
max_tries = 100L,
id_fun = blockr_option("rand_id", NULL)
)
adjective_animal(n)
sample_letters(n)
Arguments
- old_names
Disallowed IDs
- n
Number of IDs to generate
- max_tries
Max number of attempts to create IDs that do not intersect with
old_names
- id_fun
A function with a single argument
n
that generates random IDs. A value ofNULL
defaults toids::adjective_animal()
if available andsample_letters
otherwise.