Memorable IDs are useful for referencing objects with arbitrary versions. This function uses the Docker name generator code to create random memorable IDs using Data Department employee, interns, and fellow names.

ccao_generate_id(n = 1L, prefix = as.character(Sys.Date()))

Arguments

n

Integer of the number of IDs to generate. Default 1.

prefix

Prefix to append to the end of each ID, uses the system date by default. Set to NULL for no prefix or a vector of length n for multiple different prefixes.

Value

An n-long character vector of memorable IDs.

Examples

# Generate a single ID
ccao_generate_id()
#> [1] "2024-12-06-beautiful-nicole"

# Multiple IDs
ccao_generate_id(10)
#>  [1] "2024-12-06-malingering-jacob" "2024-12-06-hopeful-michael"  
#>  [3] "2024-12-06-fancy-free-rob"    "2024-12-06-amazing-kyra"     
#>  [5] "2024-12-06-cool-ethan"        "2024-12-06-quirky-rob"       
#>  [7] "2024-12-06-quizzical-manasi"  "2024-12-06-peaceful-rina"    
#>  [9] "2024-12-06-sleepy-irene"      "2024-12-06-strange-dan"      

# IDs with no prefix
ccao_generate_id(3, NULL)
#> [1] "-peaceful-julia" "-footloose-sam"  "-hungry-tayun"  

# Different prefix for each ID
ccao_generate_id(3, c("type1", "type2", "type3"))
#> [1] "type1-magical-matthew" "type2-laughing-jacob"  "type3-festive-carly"