Learn R Programming

randstr (version 0.2.0)

randStr: Generate random strings of a dictated size of symbol set and distribution of the lengths of strings. The output is a list of 2 items: [[1]]vector of strings, [[2]]vector of the corresponding symbol set

Description

Generate random strings of a dictated size of symbol set and distribution of the lengths of strings. The output is a list of 2 items: [[1]]vector of strings, [[2]]vector of the corresponding symbol set

Usage

randStr(nString, maxLen, minLen, stdevLen = 0, distLen = "normal", symbolSetSize, delimiter = "-")

Arguments

nString
Number of strings to be generated
maxLen
Maximum allowable length of the strings
minLen
Minimum allowable length of the strings
stdevLen
Standard deviation of the length of the strings, applicable if using truncated normal distribution for the lengths of strings i.e. distLen='normal'
distLen
Distribution of the lengths of strings, can take on value of 'normal' or 'uniform'
symbolSetSize
Allowable number of different symbols to appear in the strings
delimiter
symbol separating each item in the strings

Examples

Run this code
randStr(nString = 10, maxLen = 30, minLen = 1, stdevLen = 15, symbolSetSize = 25)

Run the code above in your browser using DataLab