I have a set of stimuli (statements), half of them are true and half are false. I'd like to randomly assign them to 4 sets containing an equal number of statements, of which half are true and half false statements.
Here's what I've got so far, but I need to add that the randomisation to the 4 sets shoudl be based on the contents a specific binary column (i.e., whether the statement is true or false):
statements <- data.frame(item_ID = c("1", "3", "4", "5", "6", "7"),
item = c("The first windmills were built in Persia.",
"Blackberries, raspberries, and strawberries belong to the Rose family.",
"The painting “Bal du moulin de la Galette” was created by Renoir.",
"The name of the Russian space platform Mir means ‘peace’.",
"The Congo has the largest water flow rate of any river in Africa.",
"Alberto Fujimori served as president of Peru from 1990 - 2000."
), actual_truth = c("TRUE", "TRUE", "TRUE", "TRUE", "FALSE", "FALSE"
), source = c("DK", "DK", "DK", "DK", "DK", "DK"))
ns <- nrow(statements) * c(0.25, 0.25, 0.25, 0.25)
sum(ns)
rep(1:4, times = ns)
set.seed(4)
head(samp <- sample(rep(1:4, times = ns)))
set1 <- statements[samp == 1,]
set2 <- statements[samp == 2,]
set3 <- statements[samp == 3,]
set4 <- statements[samp == 4,]