Skip to contents

A function that generates random strings

Usage

random_strings(N, string_size = 50L, charset = "abcdefghijklmnopqrstuvwxyz",
                      vector_mode = "stringfish")

Arguments

N

The number of strings to generate

string_size

Either a single non-negative integer applied to every output string, or a non-negative integer vector of length `N`.

charset

The characters used to generate the random strings (default: abcdefghijklmnopqrstuvwxyz)

vector_mode

The type of character vector to generate (either stringfish or normal, default: stringfish)

Value

A character vector of the random strings

Details

A convenience function for generating test strings.

Examples

set.seed(1)
x <- random_strings(1e6, 80L, "ACGT", vector_mode = "stringfish")
y <- random_strings(4, c(1L, 2L, 4L, 8L), "ACGT")