# 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.

• Pseudo randomness is typically just a random permutation. You can write code to do this in any general language. Not sure what you mean by "automatically". – Bryan Krause Jan 25 at 15:59
• I was actually looking for tips on how to do that, I am sorry for not being clear. – rhododendron Jan 26 at 16:08

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)
sample(c(1,1,1,1,2,2,2,2))