Generate random string

random_string(
  length = NULL,
  min_length = 1,
  max_length = 15,
  pattern = "[A-Za-z0-9]"
)

Arguments

length

integer or NULL (default), output string length. If NULL, length will be random

min_length

integer, minimum length if length is random. Default: 1.

max_length

integer, maximum length if length is random. Default: 15.

pattern

string, pattern for string to follow. Check stringi-search-charclass for details.

Value

random string

Examples

random_string(length = 5)
#> [1] "ZruNi"