A utility function for generating IDs

new_id(x, prefix = "ID", sep = "-")

Arguments

x

The data that require IDs.

prefix

A character string; the prefix to be added to each ID.

sep

A character string; the separator to be added between the prefix and an ID.

Examples

new_id(x = runif(10), prefix = "points")
#>  [1] "points-1"  "points-2"  "points-3"  "points-4"  "points-5"  "points-6" 
#>  [7] "points-7"  "points-8"  "points-9"  "points-10"