Ids based on a number of adjectives and an animal
adjective_animal(n = 1, n_adjectives = 1, style = "snake",
max_len = Inf)number of ids to return. If NULL, it instead
returns the generating function
Number of adjectives to prefix the anmial with
Style to join words with. Can be one of "Pascal", "camel", "snake", "kebab", "dot", "title", "sentence", "lower", "upper", and "constant".
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
hexakosioihexekontahexaphobic_queenalexandrasbirdwingbutterfly).
A vector of length 2 can be passed in here in which case the
first element will apply to the adjectives (all of them) and the
second element will apply to the animals.
The list of adjectives and animals comes from https://github.com/a-type/adjective-adjective-animal, and in turn from gfycat.com
# Generate a random identifier:
adjective_animal()
#> [1] "sacred_alpineroadguidetigerbeetle"
# Generate a bunch all at once:
adjective_animal(5)
#> [1] "artsycraftsy_doe" "eccentric_drever"
#> [3] "compassionless_americancicada" "unfeared_indianspinyloach"
#> [5] "diamond_cooter"
# Control the style of punctuation with the style argument:
adjective_animal(style = "lower")
#> [1] "ecological snake"
adjective_animal(style = "CONSTANT")
#> [1] "FROSTED_DUNGBEETLE"
adjective_animal(style = "camel")
#> [1] "deferentialCopepod"
adjective_animal(style = "kebab")
#> [1] "frantic-grub"
# Control the number of adjectives used
adjective_animal(n_adjectives = 3)
#> [1] "raging_carnauba_civillaw_skink"
# This can get out of hand quickly though:
adjective_animal(n_adjectives = 7)
#> [1] "intercorporate_deiform_curt_intercontradictory_semimonarchical_mirthful_congenial_dassierat"
# Limit the length of adjectives and animals used:
adjective_animal(10, max_len = 6)
#> [1] "brown_thrush" "corny_godwit" "idled_eyas" "lardy_titi" "myrtle_anole"
#> [6] "great_swift" "postal_bird" "turbid_cow" "bored_xeme" "mutual_liger"
# The lengths can be controlled for adjectives and animals
# separately, with Inf meaning no limit:
adjective_animal(10, max_len = c(6, Inf), n_adjectives = 2)
#> [1] "lionly_chaste_xinjiangovenator" "webby_mature_iguanodon"
#> [3] "legal_terse_ballpython" "mucky_fierce_dromaeosaur"
#> [5] "acrid_fussy_northernspottedowl" "public_faulty_marmoset"
#> [7] "wroth_mid_australiancurlew" "golden_united_chimpanzee"
#> [9] "poetic_wary_nuthatch" "cream_pebbly_abyssiniancat"
# Pass n = NULL to bind arguments to a function
id <- adjective_animal(NULL, n_adjectives = 2, style = "dot", max_len = 6)
id()
#> [1] "elfish.mad.civet"
id(10)
#> [1] "green.chatty.turkey" "strict.tidal.barb" "united.cruel.vixen"
#> [4] "dreary.duckie.eft" "brashy.ambery.tick" "leafed.almond.turkey"
#> [7] "cosmic.lethal.possum" "even.bleary.bovine" "sudden.fleecy.moray"
#> [10] "intact.tan.urchin"