Description Usage Arguments Details Author(s) Examples
View source: R/adjective_animal.R
Ids based on a number of adjectives and an animal
1 2 3 4 5 6 7 8 9 | adjective_animal(
n = 1,
n_adjectives = 1,
style = "snake",
max_len = Inf,
alliterate = FALSE,
global = TRUE,
use_openssl = NULL
)
|
n |
number of ids to return. If |
n_adjectives |
Number of adjectives to prefix the animal with |
style |
Style to join words with. Can be one of "Pascal", "camel", "snake", "kebab", "dot", "title", "sentence", "lower", "upper", "constant" or "spongemock" |
max_len |
The maximum length of a word part to include (this
may be useful because some of the names are rather long. This
stops you generating a
|
alliterate |
Produce "alliterative" adjective animals (e.g.,
|
global |
Use global random number generator that responds to
|
use_openssl |
Use openssl for random number generation when using a non-global generator (see random_id for details) |
The list of adjectives and animals comes from https://github.com/a-type/adjective-adjective-animal, and in turn from <gfycat.com>
Rich FitzJohn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # Generate a random identifier:
ids::adjective_animal()
# Generate a bunch all at once:
ids::adjective_animal(5)
# Control the style of punctuation with the style argument:
ids::adjective_animal(style = "lower")
ids::adjective_animal(style = "CONSTANT")
ids::adjective_animal(style = "camel")
ids::adjective_animal(style = "kebab")
ids::adjective_animal(style = "spongemock")
# Control the number of adjectives used
ids::adjective_animal(n_adjectives = 3)
# This can get out of hand quickly though:
ids::adjective_animal(n_adjectives = 7)
# Limit the length of adjectives and animals used:
ids::adjective_animal(10, max_len = 6)
# The lengths can be controlled for adjectives and animals
# separately, with Inf meaning no limit:
ids::adjective_animal(10, max_len = c(6, Inf), n_adjectives = 2)
# Pass n = NULL to bind arguments to a function
id <- ids::adjective_animal(NULL, n_adjectives = 2,
style = "dot", max_len = 6)
id()
id(10)
# Alliterated adjective animals always aid added awesomeness
ids::adjective_animal(10, n_adjectives = 3, alliterate = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.