generateRandomIDs | R Documentation |
This function generates a set of random IDs for use in experiments where participant anonymity is important. The IDs are not generated with R's random number generator, but uses openssl.
generateRandomIDs(
checkFile = "randomIDs.csv",
IDlength = 3,
number = 100,
addToFile = checkFile
)
checkFile |
CSV file with previous IDs that should not be duplicated |
IDlength |
Number character pairs to use for IDs (3 is 6 characters) |
number |
How many IDs to add to the existing list. |
addToFile |
What CSV file to write the IDs to. |
The function does not yet check if it is possible to generate as many unique IDs as requested with the given length, so be careful not to start an endless loop. (With 1 bit, you only get 256 combinations in total.)
When opened in spreadsheet software, some IDs could be interpreted as a type of number, but when read in with most kinds of software, they work OK.
generateRandomIDs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.