| random_strings {stringfish} | R Documentation |
A function that generates random strings
random_strings(N, string_size = 50, charset = "abcdefghijklmnopqrstuvwxyz",
vector_mode = "stringfish")
N |
The number of strings to generate |
string_size |
The length of the strings |
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) |
The function uses the PCRE2 library, which is also used internally by R. Note: the order of paramters is switched compared to the 'gsub' base R function, with subject being first. See also: https://www.pcre.org/current/doc/html/pcre2api.html for more documentation on match syntax.
A character vector of the random strings
gsub
set.seed(1) x <- random_strings(1e6, 80, "ACGT", vector_mode = "stringfish")