Generate a vector of a values from a set
set_vector(size, set = NULL, set_type = NULL, set_size = NULL, ...)
integer, vector length
vector a set of values to pick from; default: NULL
string if set is NULL generate a random set of type ("integer", "string", "boolean", "numeric"); default: NULL
integer, number of elements in random set; default: NULL
additional arguments for random set generator.
For details check random_vector
When using a random set, be aware, that set has to be unique, thus if arguments passed to generator do not allow this, the function can end up in an infinite loop.
set_vector(10, set = c("a", "b", "c"))
#> [1] "c" "b" "a" "c" "b" "c" "c" "c" "c" "c"
set_vector(size = 5, set_type = "string", set_size = 3)
#> [1] "rPDr" "rPDr" "y3MPq5dLywG6Wc" "kyHLcyKSAE"
#> [5] "y3MPq5dLywG6Wc"