R function to randomly assign participants to experimental conditions