Sample a set of strings, each string of a given length
Arguments
- nchar
The length of each string.
- size
The number of strings.
- upper
Should the strings be upper case?
Examples
set.seed(42)
sample_strings()
#> [1] "xyh"
d <- data.frame(key = sample_strings(7,9), value=1:9)
d[order(d$key),]
#> key value
#> 4 cnkxlvt 4
#> 3 dmoxdzy 3
#> 8 kubtreg 8
#> 2 lsygmyz 2
#> 9 nrztowe 9
#> 5 vkravaf 5
#> 1 vqntdrs 1
#> 6 xpjlazl 6
#> 7 yxqzqij 7