Generate random strings of any length using a combination of uppercase or lowercase letters and digits 0-9.

rand_str(
  num_strings = 10,
  length = 6,
  digits = TRUE,
  upperalpha = TRUE,
  loweralpha = TRUE,
  unique = TRUE
)

Arguments

num_strings

Number of strings

length

Length of strings

digits

Logical: TRUE and digits will be in string, FALSE and they won't.

upperalpha

Logical: TRUE and capital letters will be in string, FALSE and they won't.

loweralpha

Logical: TRUE and lowercase will be in string, FALSE and they won't.

unique

Logical: TRUE and strings will be unique, FALSE and they may not be.

Value

A character vector of random strings defined by the parameters as above.

Examples

user_ids <- data.frame(id = rand_str(num_strings = 50))