Automatic pseudo-randomization of stimuli in R I was wondering if it's possible to automatically pseudo-randomize stimuli in R? If so, I would be very grateful for any help.
You can use the &quot;sample&quot; function: https://stat.ethz.ch/R-manual/R-devel/library/base/html/sample.html
Start with a list of the stimuli you want to present. For example, if you have two stimuli that should be repeated 4 times each, your list would be c(1,1,1,1,2,2,2,2)
If you take 8 samples from this distribution without replacement, you have a random permutation of the list. This is the default behavior if you just give the original list, like this:
sample(c(1,1,1,1,2,2,2,2))