Generates a set of Random Letters.

r_letters(nchar = 1, ..., n = default_n(nchar), .seed = NULL)

r_LETTERS(nchar = 1, ..., n = default_n(nchar), .seed = NULL)

r_Letters(nchar = 1, ..., n = default_n(nchar), .seed = NULL)

Arguments

nchar

vector of number of characters to return, positive integer

...

Unused

n

number of observations to generate. The default_n() function will provide a default value within context

.seed

One of the following:

  • NULL (default) will not change the current seed. This is the usual case for generating random numbers.

  • A numeric value. This will be used to set the seed before generating the random numbers. This seed will be stored with the results.

  • TRUE. A random seed value will be generated and set as the seed before the results are generated. Again, this will be stored with the results.

To extract the random seed from a previously generated set of values, use pull_seed()

Value

A character vector of length n

Functions

  • r_letters: Uses only lower-case letters

  • r_LETTERS: Uses only upper-case letters

  • r_Letters: Uses lower- & upper-case letters

Examples

set_n(5) r_letters(3)
#> [1] "kyb" "yiq" "kas" "cpj" "yeh"
r_letters(1:10)
#> [1] "c" "mn" "pla" "nfzy" "rlxfz" #> [6] "pdisgp" "lrcztvi" "jonoombz" "ikuzoetrb" "dlbujtpxrq"
r_letters(3, n = 10)
#> [1] "sxv" "yzi" "evv" "agh" "smz" "zjk" "jks" "xda" "gad" "ocn"
r_LETTERS(3)
#> [1] "XBN" "WEF" "NKG" "JSV" "BJZ"
r_LETTERS(1:10)
#> [1] "F" "XC" "IQA" "FYMI" "QNFJF" #> [6] "IKZDXL" "LWGKEWP" "EKAEBIAH" "SQZRDZHPG" "DURWWZHAPB"
r_LETTERS(3, n = 10)
#> [1] "DAF" "NVR" "VKQ" "CBZ" "OLN" "AJC" "UUM" "COS" "EYZ" "ZPJ"
r_Letters(3)
#> [1] "uCJ" "ajy" "ndz" "iei" "vFh"
r_Letters(1:10)
#> [1] "k" "px" "aXG" "Cins" "YvpqJ" #> [6] "bmKajJ" "xwWoWwc" "NlUsRSlv" "fNnsEKdxU" "RYgMNllNJy"
r_Letters(3, n = 10)
#> [1] "CLr" "LQx" "lUW" "Eob" "WIy" "Xfh" "cPA" "Fym" "VCP" "tnw"