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-06-03-beautiful-nicole"

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