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)
resolve_ctor(ctor, ctor_pkg = NULL)
is_blockr_ctor(x)
ctor_name(x)
ctor_pkg(x)
ctor_fun(x)
to_sentence_case(x, replace = character(), with = character())
id_to_sentence_case(x)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
nthat generates random IDs. A value ofNULLdefaults toids::adjective_animal()if available andsample_lettersotherwise.- ctor
Function (either a string, a function or number used to index the call stack
- ctor_pkg
The package where
ctoris defined (either a string orNULLwhich will use the function environment)- x
Character vector to transform
- replace, with
Mapped to
base::gsub()