Randomizing Experimental Material

Sometimes we need to randomize our experimental material for every speaker and repetition. To this purpose, I wrote a quick script in R,  which you can modify to fit your own purposes. The script saves the experimental material of each speaker in a different file in the path you should define at the top of the code.

setwd("/Users/")   # Export Path
a <- c(
for (num in 1:10) # Number of Speakers.
  sink(paste("SPEAKER ",num,".txt", sep=""))
  cat(paste("SPEAKER", num),sep="\n")
for(i in 1:6) # Number of Repetitions per Speaker. 
  b <- sample(a)
  cat(paste("Repedition ",i),sep="\n")



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s